No, most times the guy is offside, infact, Mexico looked to be offside against France, everyone said it was offside and the guy scored and it turned out he was lucky, cos he was onside.
The offside rule is to prevent a player to go behind the defence line and score since its very easy when there's only one person to get passed.
| ..|
.... |
...... | .. | ........ |
.....|
So easy for that person to score if the ball is passed to him via an overhead kick and he volleys or heads it into the net.