You're trating a slideshow as the actual rules. The slideshow largely ignolres the When factor because it's the simplest most basic part nobody ever gets wrong until now.
The Actual Laws of the Game state:
A player in an offside position
at the moment the ball is played or touched by a team-mate is only penalised on becoming involved in active play by:
• interfering with play by playing or touching a ball passed or touched by a team-mate or
• interfering with an opponent by:
• preventing an opponent from playing or being able to play the ball by clearly obstructing the opponent’s line of vision or
• challenging an opponent for the ball or
• clearly attempting to play a ball which is close to him when this action impacts on an opponent or
• making an obvious action which clearly impacts on the ability of an opponent to play the ball or
• gaining an advantage by playing the ball or interfering with an opponent when it has:
• rebounded or been deflected off the goalpost, crossbar or an opponent
• been deliberately saved by any opponent
Everyone one of these is dependent on the player being offside when the ball is played or touched by a teammate.
http://www.fifa.com/mm/Document/Foo.../92/44/Laws.of.the.Game.2016.2017_Neutral.pdf