I guess I don't understand the offside rule after all.
There's a little thing about it I didn't know for the longest time, that a player has to be behind two opposition players to be onside. We don't ever think about it that way because 99% of the time one of those two players is the goalkeeper, but in situations like today it can happen that a player is behind a defender and still off because the goalie came up for the ball.
Even then, there's a lot about that goal that's confusing as to why it was offside, but after watching it a few times and paying good attention to what's going on, I realized the VAR actually made the right call. Cross comes in, guy heads the ball into the air, it bounces, and then the other guy comes and heads it - this second player was offside when the other one headed it earlier. In all truth, the way they showed the replay, with that silly looking 3D and all, only made it more confusing, because the most important thing here was to understand the context of the offside, rather than the lines themselves.