white should not have traded queens, but even after that they can secure a win by playing f5 and opening a file
Draw by repetition in a losing position
White has an extra rook, so opening that file might be worth it.
White's decision to perform threefold repetition is likely coming from the fear of "losing pawns" by pushing the f-pawn.
As a side note, the long diagonals a1-h8 and a8-h1 are often overlooked, so pay close attention to them in the opening phases carefully.
With nearly 5 minutes on the clock, would play 36.Bf5 which further restricts Black's options; follow up with Kg2, possibly to f3, e4 or g4. Kg2 opens the 8th rank and h-file. White definitely has options on the King side while black marks time. Look to trade off pieces.
I somehow managed to get a draw by repetition out of this losing position. What should my opponent have done to win the game?