They follow the following rules:
A player always tries to win: if a player can place his own symbol (X or O) in a row which already contains two of his own symbols, he will do so.
A player always tries to avoid that his opponent wins: if a player can place his own symbol (X or O) in a row which already contains two of the symbols of his opponent, he will do so.
Of course, the first rule has precedence over the second rule, because the game can be won in this way.
In the game shown on the right, 6 moves have been done. David plays with crosses (X) and Angela plays with circles (0). However, we don't know who started the game.
Who will win this game?
If you're like me, you may be having trouble seeing the image of the board I tried to create. So here's a more basic image:
O | O |
O | X |
X | X |