Black had to sacrifice the queen. Here is the line if black does not sacrifice the queen: Rd1+ Ke8 (Bd7 leads to Rdxd7+)Qh5+ Kf8 Qf7#.
Hope this helps
Basically after g5, Rd1 wins for white. The point is that both Bd7 and Ke8 fail very quickly. Bd7 and white takes with d1 rook, and afterwards check on h5, resulting with queen mate on f7. Ke8 fails because of an immediate Queen check on h5 and aforementioned mate.
The only logical try is Qd6. Any other queen move, white takes the queen with d1 rook and the same mate will follow. So what on Qd6? There are 2 solutions but one of them is really difficult for lower rated people, I probably wouldn't try it either. Rxd6+ still wins but it looses the rook on c7 as the rook blocks his own bishop, so the better solution is to take on d6 with the bishop.
Now after this it looks complicated but all you need to see is that black has only 1 semi active piece, his knight and it is sidelined. The other pieces are on the first rank, while king is still very vulnerable. So without calculation one should know that white is more than likely winning. At the moment it is black's move but he has to deal with potential discovered check, and generally very weak king.
Here you can see a diagram for yourself:
Computer thinks that white have it in the bag with this black pawn move.
Can somebody enlighten me how white could win here?
Thanks in advance,