Basically. If
(a) you are on the half of the field where the goal you score on is
and
(b) the ball is behind you. That is, you are closer to the goal you score on than the ball is.
Then,
at least two players from the opposite team must be closer to the goal than you are at the time a pass is played to you.
The rule is made to stop basket hanging, cherry picking, e.g. standing next to the other goalie waiting for a pass.
You can mostly assume that the goalie is on the goal line, so you mostly look at where the defender closest to the goal is when a pass occurs.
The black line on the TV replays they are showing is a line drawn through the defender who's closest to the goal he's guarding.
If an offensive player is in the black, he's offside.
This is a basic description. There are some variables involved, but if you can get a grasp of the basic rule you should be able to understand the calls most of the time.
USA is running out of time.
USA has to go for it now, however, big danger of giving up one here.
Thank you so much for your explanation and time.
What you wrote was very helpful.