To win the game, a player must place three of their marks in a horizontal, vertical, or diagonal row.
There is no universally-agreed rule as to who plays first, but in this article the convention that X plays first is used.
Players soon discover that the best play from both parties leads to a draw. Hence, tic-tac-toe is most often played by young children, who often have not yet discovered the optimal strategy.