When gaining control of an opponent's target creature, who do effects of that card that apply to?
In general, &quot;you&quot; always refers to an objects controller, or if it doesn't have one, its owner. This is specified with some more detail in rule 109.5. For example, if a card is on the battlefield, &quot;you&quot; refers to its controller, and if a card is in a graveyard, &quot;you&quot; refers to its owner.
In the specific example of taking control of Yavimaya Elder and sacrificing it, you (the controller) would search your library for the lands and put them into your hand. This is because Yavimaya Elder's ability is a &quot;leaves-the-battlefield ability&quot;, which means that the following parts of the triggered ability rules apply:

603.10. Normally, objects that exist immediately after an event are checked to see if the event matched any trigger conditions, and continuous effects that exist at that time are used to determine what the trigger conditions are and what the objects involved in the event look like. However, some triggered abilities are exceptions to this rule; the game “looks back in time” to determine if those abilities trigger, using the existence of those abilities and the appearance of objects immediately prior to the event. The list of exceptions is as follows:

603.10a Some zone-change triggers look back in time. These are leaves-the-battlefield abilities, abilities that trigger when a card leaves a graveyard, and abilities that trigger when an object that all players can see is put into a hand or library.


This means that when Yavimaya Elder dies, its triggered ability considers how it existed when it was last on the battlefield. This includes the fact that you controlled it, so you also control the ability and the &quot;you&quot;s in the ability refer to you.