The FIDE Laws of Chess

Article 4:  The act of moving the pieces 

4.1  Each move must be made with one hand only. 

4.2  Provided that he first expresses his intention (e.g. by saying "j'adoube" or "I adjust"), the player having the move may adjust one or more pieces on their squares. 

4.3  Except as provided in Article 4.2, if the player having the move deliberately touches on the chessboard 

  • a.  one or more of his own pieces, he must move the first piece touched that can be moved, or 
  • b.  one or more of his opponent's pieces, he must capture the first piece touched, which can be captured, or 
  • c.  one piece of each colour, he must capture the opponent's piece with his piece or, if this is illegal, move or capture the first piece touched which can be moved or captured. If it is unclear, whether the player's own piece or his opponent's was touched first, the player's own piece shall be considered to have been touched before his opponent's.
  • a.  If a player deliberately touches his king and rook he must castle on that side if it is legal to do so. 
  • b.  If a player deliberately touches a rook and then his king he is not allowed to castle on that side on that move and the situation shall be governed by Article 4.3(a). 
  • c.  If a player, intending to castle, touches the king or king and rook at the same time, but castling on that side is illegal, the player must make another legal move with his king which may include castling on the other side. If the king has no legal move, the player is free to make any legal move. 
4.5  If none of the pieces touched can be moved or captured, the player may make any legal move. 

4.6  A player forfeits his right to a claim against his opponent's violation of Article 4.3 or 4.4, once he deliberately touches a piece. 

4.7  When, as a legal move or part of a legal move, a piece has been released on a square, it cannot then be moved to another square. The move is considered to have been made when all the relevant requirements of Article 3 have been fulfilled.