Code not working

I have written the code of tic tac toe but it is not working for Tie/draw case :

see this correct code: