The biggest mistake is the attacker, all he had to do was delay his run by a fraction of a second and he'd have been in his own half. Or his team mate who didn't need to pass the ball, he could have just carried on running, although they'd probably have then still stuffed it up by passing to the other attacker who would have been ahead of the ball.
Utterly baffling how professional footballers can so badly misunderstand the offside law. There should have been several red cards shown by the referee after that.