The actual rule is, you can have a player in an offside position when the goal is scored, as long as he is not interfering with play.
They may have changed it when I was a Ref, but back then the rule was, "The player is offsides if he has to be considered as in the play."
I.E. If the guy is offsides, and the ball passes him, he is offsides even if he does not go for the ball. The key is if the Goaly has to make the decision or move on him like he will play the ball, he is offsides even if he doesn't play the ball.