You must have gained life before your end step begins. Lone Riderâ€™s last ability wonâ€™t trigger if you havenâ€™t, even if an ability triggering at the same time will cause you to gain life.
Lone Riderâ€™s last ability triggers even if it wasnâ€™t on the battlefield when you gained the life this turn.
Lone Riderâ€™s ability checks how much life youâ€™ve gained during the turn, not what your life total is compared to what it was when the turn began. For example, if you gained 4 life and then lost 7 life this turn, it still triggers.
In a Two-Headed Giant game, events that cause a player to gain life affect each player separately, even though the result affects the teamâ€™s life total. For example, if your teammateâ€™s creatures with lifelink dealt 5 damage, your teammate gained life, not you, and Lone Riderâ€™s last ability wonâ€™t trigger.
For more information on double-faced cards, see the Shadows over Innistrad mechanics article (http://magic.wizards.com/en/articles/archive/feature/shadows-over-innistrad-mechanics).