with a rook, the king may make a special move called 'castling'. this is when the king moves two squares toward one of its rooks and then the rook is placed on the other side of the king. castling consists of moving the king two squares on its first rank toward either one of the first rooks, then moving the rook onto the square over which the king crossed. castling is only allowed when the king nor the castling rook has moved already, when no squares between them are occupied, when the king is not in check, and when the king will not move across or end its movement on a square that puts the king in check.