it is not moves its positions. if the same position occurs three times then either player can claim a draw. it is important to remember that castling rights are a part of the position and as such must also be the same. it is also worth noting that these three positions need not be consecutive.
Stalemate

I think the 50 move rule works, as well. After 50 moves with no capture or pawn move, you can click on "claim draw" and the game will end in stalemate. Same goes for repeating the same position 3 times in a row. It doesn't do it for you automatically.
Is there any ruling on how many times both sides are allowed to repeat the same move consecutively or does it automatically become stalemate?