Here is a picture of the starting position. White to move.
[FEN "8/8/8/3nk1pp/8/3K2PP/5P2/8 w - - 0 1"]
1. f3 h4 2. f4+ gxf4 3.gxf4+ Kxf4 4. Ke2 Kg3 5. Kf1 Kxh3 6. Kg1 Kg3
1. f3 h4
2. f4+ gxf4 (to make it into king and knight + rook pawn endgame which is drawn)
3.gxf4+ Kxf4
4. Ke2 (to reach the g1 and h1 squares to draw)
4... Kg3
5. Kf1 Kxh3
6. Kg1 Kg3
I forgot the rest of the moves, but somehow it's losing for white. I thought a king and knight + rook pawn is always drawn if the opponent's king can reach the g1 h1 squares. Why didn't it work this time and when are these endgames drawn?