Move your king two squares toward the rook
Move the rook to the square the king crossed over
Kingside castling: king moves from e1 to g1, rook moves from h1 to f1
Queenside castling: king moves from e1 to c1, rook moves from a1 to d1
The king and the rook must not have moved before
There must be no pieces between the king and the rook
The king cannot be in check
The king cannot pass through a square that is under attack
The king cannot end on a square that is under attack
On Chess.com, click or drag the king to the castling square if the move is legal
