I believe the rule you're looking for is this one:
217.1c An object that moves from one zone to another is treated as a new object. Effects connected with its previous location will no longer affect it. There are two exceptions to this rule: Effects that edit the characteristics of an artifact, creature, or enchantment spell on the stack will continue to apply to the permanent that spell creates, and abilities that trigger when an object moves from one zone to another (for example, “When Rancor is put into a graveyard from play”) can find the object in the zone it moved to when the ability triggered.