I was having trouble understanding this also, until I'd seen all the replays and read a full explanation, after which it became clear.
In the still image shown in post #6 by
@Zoophonic, Estupinian is challenging the goalkeeper for the ball. According to the VAR team (who had access to multiple normal speed and slow motion replays from various different camera angles) Estupinian got the last touch before the ball went up in the air and at that point, Estrada was marginally offside (that's the still they showed with the number 11 player's left foot and part of his left leg beyond the offside line).
After the ball bounced off the ground, that player (Estrada) then headed the ball back to Torres, who knocked the ball across for Valencia to put it in the net.
So basically, Estrada was in an offside position when Estupinian headed it, then came back and became involved in active play by heading the ball to Torres (thereby committing an offside offence).
It was extremely difficult to see in real time and even on the first couple of replays but now that we have the full sequence of events, I think the decision becomes easier to understand.
I thought it wasn't particularly helpful that the only still they showed at first (and for a long time) was of the player in an offside position (Estrada) but without showing where he was in relation to all the other players at the time or explaining at which point in the somewhat complicated sequence of events, he was in an offside position.