Three (bad) things happened:
- You weakened your kingside by playing
g4
. - Black castled O-O-O, to take advantage of number 1, while protecting his king behind the phalanx of (doubled) pawns.
- The worst thing that happened was that
13. Nxg6 hxg6
opened up the h file for Black in front of a rook that had not moved. You should have moved the N back tof3
to keep a defender in place, and to keep the h file closed. On move 14, your best chance was the defensiveQf3
, rather than the developingd4
. You had a won game up to move 13, and a lostquestionable game after14...Rxh3
(Black could have played differently than he did and gotten a perpetual check to compensate for his piece down.)