It's called castling.
Castling
One other special rule is called castling. This move allows you to do two important things all in one move: get your king to safety (hopefully), and get your rook out of the corner and into the game. On a player’s turn he may move his king two squares over to one side and then move the rook from that side’s corner to right next to the king on the opposite side. (See the example below.) In order to castle, however, it must meet the following conditions:
- it must be that king’s very first move
- it must be that rook’s very first move
- there cannot be any pieces between the king and rook to move
- the king may not be in check or pass through check
Notice that when you castle one direction the king is closer to the side of the board. That is called kingside. Castling to the other side, through where the queen sat, is called castling queenside. Regardless of which side, the king always moves only two squares when castling.
hello, i've just joined and i'm only a beginner. i have been playing the computor (on easy) and i've noticed after the first couple of moves the computors king keeps making an illegal move. it keeps swapping places with the castle, maybe i'm wrong but i always thought the king could not jump over pieces. can anyone shed some light on this for me please?