Have a screw loose

To act in a strange way, to be foolish, to be crazy.

The man is very strange. I think that he has a screw loose somewhere.