A player is in an offside position if they're in the opponents' half and closer to the goal line than both the ball and the second-last opponent when a teammate plays or touches the ball. Everything below is the same pitch, attacking left to right. The amber line is the one to watch.