The main goal of chess is to checkmate your opponent's
King. The King is not actually captured and removed from
the board like other pieces. But if the King is attacked
("checked") and threatened with capture, it must get out
of check immediately. If there is no way to get out of
check, the position is a "checkmate," and the side that is
checkmated loses.
You may not move into check. For example, moving into a
direct line with your opponent's Rook, when if there are
no other pieces between the Rook and your King, is not a
legal move. Otherwise, the Rook could "capture" the King,
which is not allowed.
If you are in check, there are three ways of getting
out:
-
Capturing the attacking
piece
-
Placing one of your own
pieces between the attacker and your King (unless the
attacker is a Knight)
-
Moving the King away from
the attack
If a checked player can do none of these, he is
checkmated and loses the game.
If a King is not in check, but that player can make no
legal move, the position is called a stalemate and the
game is scored as a draw, or tie.