You and the AI alternate moving the rook. The player who moves it to the bottom-left corner wins.
First, you choose where the rook starts. Then, the AI chooses who goes first.