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 consists of moving the king two squares on its first rank toward either one of the original rooks , then moving the rook onto the square over which the king crossed .