I have pounded over tons of site to try to figure out the off sides rule on “gaining an advantage by being in that position”.

When is that position determined? At time of the offenses last attack, on the rebound from the defender, on the rebound from the goal post. I understand if the offensive player is in an offside position at the time of their teammates playing the ball and it rebounds they are offside if they play the ball.

I don’t know how many times I have seen the following scenario. Ball is played by the offense with everyone onside and no player offside, ball rebound (off the goalpost, defender) at the time of the rebound one or more offense players are between the second defender and goalie. Sometimes I see no offside called sometimes I see the offside called. I have heard AR’s explain to other people it hit the goalpost or it came off the goalie.

If the rule is where the players are at when the ball is struck by the offense what is the purpose of the “gaining an advantage by being in that position” even being said.

USSF answer (September 17, 2010):
The rule is that the offside infringements are punished at the place where the player in the offside position was when his teammate played the ball.

You will find the following guidance in the Interpretations of the Laws of the Game and Guidelines for Referees in the Laws of the Game 2010/2011:

In the context of Law 11 — Offside, the following definitions apply:
• “nearer to his opponents’ goal line” means that any part of a player’s head, body or feet is nearer to his opponents’ goal line than both the ball and the second last opponent. The arms are not included in this definition
• “interfering with play” means playing or touching the ball passed or touched by a teammate
• “interfering with an opponent” means preventing an opponent from playing or being able to play the ball by clearly obstructing the opponent’s line of vision or movements or making a gesture or movement which, in the opinion of the referee, deceives or distracts an opponent
• “gaining an advantage by being in that position” means playing a ball that rebounds to him off a goalpost or the crossbar having been in an offside position or playing a ball that rebounds to him off an opponent having been in an offside position

When an offside offense occurs, the referee awards an indirect free kick to be taken from the position of the offending player when the ball was last played to him by one of his teammates.

We hope this is helpful. As to what and when it is called, we cannot guarantee that referees will always get the call right.