It's very simple. If the same position occurs for the third time (with the same player to move), the game is a draw.
https://support.chess.com/article/1042-i-got-a-draw-by-repetition-how-did-that-happen
Thanks