If the same position happens three times, with the same player to move, the game is a draw. This is called threefold repetition.
8
7
6
5
4
3
2
1a
b
c
d
e
f
g
h