I would make a few starting scenarios with some if's, but after the initial move, it should be a blocking game unless there is a winning play. Something like this:
if the computer is first - I would put it in the center square
then if the player puts his in a corner, randomly place the computer's in any of the squares that would not be blocked by the player move. Repeat this each time taking into account all the player's moves.
if the player is first - there's no strategy but to block. Randomly place the computer's first move anywhere there's an open spot. When the player makes his next move, check the line for the spot to block.
Each move, check for a line for the win.... It's a simple game, but is a good logic starter to hone your skills on.
The fastest code is the code never written.