Blue 16 in an offside position runs towards the ball but he does not prevent the opponent (white 2) from playing or being able to play the ball. Blue 16 is not challenging an opponent (white 2) for the ball. No offside offence.
Yellow 4 in an offside position is penalised for playing or touching the ball that is played to him from a deliberate save by the goalkeeper having been in an offside position when the ball was last touched or is played by a team-mate (yellow 23). Offside offence.
The shot by a team-mate (blue 18) is deflected by an opponent (red/white 35) to attacker (blue 7) who is penalised for playing or touching the ball having previously been in an offside position. Offside