The game starts with the white player. The white player can move any white piece. The black player can move any black piece. The game ends when one player is in checkmate.
The pawn can move one square forward, or two if it is the first move. It can only capture pieces that are one square diagonally in front of it. It cannot move backwards.
The rook can move any number of squares horizontally or vertically. It cannot jump over pieces.
The knight can move in an L shape, two squares horizontally and one square vertically, or two squares vertically and one square horizontally. It can jump over pieces.
The bishop can move any number of squares diagonally. It cannot jump over pieces.
The queen can move any number of squares horizontally, vertically, or diagonally. It cannot jump over pieces.
The king can move one square in any direction. It cannot jump over pieces. If the king is in check, it must move out of check. If it cannot, it is checkmate and the game is over.
Castling is a special move that can only be done once per game. It involves the king and a rook. The king moves two squares towards the rook, and the rook moves to the other side of the king. The king cannot castle if it is in check, if it will move through check, or if it will end up in check. The king cannot castle if it has moved before. The king cannot castle if there are pieces between it and the rook. The king cannot castle if it is in check, if it will move through check, or if it will end up in check. The king cannot castle if it has moved before. The king cannot castle if there are pieces between it and the rook.
En passant is a special move that can only be done once per game. It involves a pawn and an enemy pawn. The enemy pawn must have just moved two squares forward. The pawn can capture the enemy pawn as if it had only moved one square forward. The pawn cannot capture the enemy pawn if it has moved before.
Promotion is a special move that can only be done once per game. It involves a pawn. If the pawn reaches the other side of the board, it can be promoted to a queen, rook, bishop, or knight.