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