Easy, pretty much the same as American football. You cannot have an offensive player behind the deepest defender before the ball is passed to that player.
the way it gets called is very subjective unlike offsides in American football.
However, to further complicate things, just because a player is in an offside position on the field doesn’t mean they are committing an offside offense. The reason being, the rule requires a player to be “actively involved in the play” before the referee will penalize them for being offside, but that's not how it always interpreted or gets called.