first thing - a player can only be offside in the oppositions half!
the decision is made when the pass is hit - not when the attacker touches the ball.
when the pass is hit there must be at least two defenders between the attacker and the goalline. usually the goalkeeper counts as one of them so the linesman only has to keep his eye on the attacker and one of the defenders.
then there is the problem of when an attacker is retreating/interfering with play! this is far more difficult and everyone has their own interpretations of the law.

but its normally a pretty safe bet to just award everything to man united!!
did i make that easy enough?