Castling in Chess
Castling is a special move in chess that allows a player to move the king and one rook during the same turn. It is the only move in chess that involves two pieces moving simultaneously.
Castling is governed by strict rule conditions and is legal only when all required conditions are satisfied.


What Is Castling?
Castling is a special move in which the king moves two squares toward a rook on its original square, and that rook moves to the square the king crossed.
The move counts as a single turn and is executed by the player controlling both pieces.
Castling is one of the officially recognised special moves in chess and remains subject to the full legality system of the game.
Kingside and Queenside Castling
There are two types of castling:
Kingside castling (short castling)
The king moves two squares toward the rook on the h-file. The rook moves to the square immediately next to the king on the opposite side.
Queenside castling (long castling)
The king moves two squares toward the rook on the a-file. The rook moves to the square immediately next to the king on the opposite side.
In both cases, the king and rook must begin on their original starting squares.


How Castling Works
When castling is performed:
- The king moves two squares toward the chosen rook.
- The rook moves to the square the king crossed.
- Both movements occur as a single legal move.
The king moves first as part of the castling action. Castling cannot be broken into separate moves and cannot be partially completed.
Conditions Required for Castling
Castling is legal only if all of the following conditions are satisfied:
- The king has not previously moved.
- The rook involved has not previously moved.
- Both the king and rook are on their original starting squares.
- No pieces stand between the king and the rook.
- The king is not currently in check.
- The king does not begin on, pass through, or end on a square that is under attack.
If any one of these conditions is not met, castling is illegal.
All standard legality rules also apply, including turn order and king safety.


What Does Not Prevent Castling
Certain factors do not affect castling legality:
- The rook may begin on or pass through a square that is under attack.
- The rook may be attacked before or after castling.
- Squares beyond the king’s movement path do not affect legality.
Only the king’s starting square, path, and destination square are evaluated for attack restrictions.
Castling Rights
Castling rights depend entirely on whether the king or the rooks have previously moved.
If the king moves at any point in the game, castling rights are permanently lost on both sides.
If a rook moves, castling rights are permanently lost on that specific side, even if the rook later returns to its original square.
Castling rights cannot be restored once forfeited.

Common Misunderstandings About Castling
Can you castle out of check?
No. The king may not be in check at the start of the move.
Can you castle through check?
No. The king may not pass through a square that is under attack.
Can you castle into check?
No. The king may not land on a square that is under attack.
Can you castle if the rook is under attack?
Yes. The rook may be under attack, provided all king-related conditions are satisfied.
Does castling count as two moves?
No. Castling counts as one move.
