M.K.
I agree with Page and Thea, and add to their suggestions that you get him some object he can play with at school to help distract his hands: like a foam pencil grip, a worry stone or foam ball, or other tactile thing. He may be unconsciously doing it to relieve stress, and while he should be more conscious of his actions, another source of stimulation may help.