The offside law is probably the most guessed at by youth coaches and spectators. Pitty the spectator who got the wrong explanation from a coach who almost knows the offside Law, but in reality can't adequately explain it.
First let's talk about OFFSIDE POSITION. A player without the ball is in an offside position when he or she is on the opposing side of the field, in front of the ball and has less than two opposing players between him/her and the goal. One of these two players can be the goalkeeper. That includes any part of the body except the arm.
It is not against the law to be in an offside position.
The player becomes offside if while in the offside position, a teammate plays the ball forward and the offending player seeks to take advantage. This can be by being or moving to an advantage place or even blocking a keeper's view.
Experienced referees almost always get it right depending on the Assistant Referee (AR) to see and signal it. I was an AR at a U16 Boys game when a goal was scored. The coach who's team was scored on loudly complained that it was offside when I didn't signal one. The center referee mentioned it after the game and chuckled when I told him that the ball had come off the other team first before the player in an offside position scored the goal.
If you care to read all the "decision" of the official game, check out FIFA's Laws of the Game.