The most common of these rules is castling, a move that is normally used to improve the king's safety. Castling is the only move that allows two pieces to move at the same time - the king and a rook.
Castling can only be done if the following conditions are all present:
- Neither the king nor the rook being used have been moved yet during the game. If either piece has been moved then castling is not allowed, even if the piece is moved back to its original square.
- All of the squares between the king and the rook must be empty.
- The king must not be in check, nor can castling move the king through a square where he would be in check.
If all these conditions are met, castling is done by moving the king two squares towards the rook, while the rook hops over the king, landing on the square next to the king.
This may sound confusing, but in practice it is simple. In the diagram above, the white king and rooks are positioned where they should be before castling. The black kings and rooks are positioned properly after castling.
Castling kingside is more common, and leaves the king on the g-file while the rook moves to the f-file. Castling queenside leaves the king on the c-file, while the rook moves to the d-file.