Chess Castling
Once per game, each king can make a move known as castling. Castling consists of moving the king two squares toward a rook of the same color on the same rank, and then placing the rook on the square that the king crossed.
Castling is permissible if the following conditions are met:[2]
- Neither the king nor the rook has previously moved during the game.
- There are no pieces between the king and the rook.
- The king is not in check and does not pass through or finish on a square attacked by an enemy piece.
Castling is still permitted if the rook is under attack, or if the rook crosses an attacked square.