(1) You should provide the link to the game you're talking about in the future - this time I found it for you: https://www.chess.com/live/game/1955523229?username=kossmelee
(2) You should learn the rules of the game - the king may castle if and only if each of the conditions are met:
*The king has not moved.
*When the king castles, he is not moving through or onto any squares attacked by the enemy
*The king is not in check when he wishes to castle
*The rook that is used for castling has not moved
(3) If you don't know what "en passant" is, you should look that up as well. Good luck.
im not really good at the game, but i have always thought that you cant castle when the squares between your rook and king including their respective squares are under attack, im assuming im wrong because i forked a queen and a rook in elegant fashion and he castled with the named rook.