The line of scrimmage serves the same purpose in American football, and basketball has the three second rule. Same principle.
The offside rule in soccer is like football except that, since soccer is a continuous motion game, the "line of scrimmage" is constantly shifting. Players caught on the wrong side of it must get back onsides before participating in a play.
A player is not off sides IF the pass is made or started before the player gets beyond the last defender between the goal and him. Is that correct?