elif rows[4][2] and rows[3][3] and rows[2][4] and rows[1][5]=='O': return "O Wins"
As already stated, you must move the call to main() to the end of your program; however the above syntax is WRONG.
It should be:
elif rows[4][2] == 'O' and rows[3][3] == 'O' and rows[2][2] == 'O' and rows[1][5] == 'O':