He looks at me then looks away, but other times he holds eye contact?

Sometimes I notice this guy glancing at me and when I catch him, he looks away. But other times he randomly turns around (he sits in front of me at school) and gives me this intimidating stare with a straight face for like 10 seconds (its really funny and he does it on purpose - I think he's trying to make me laugh?) and then smiles. Why does he do this?

(by the way, I don't know if he's a "shy" guy or not because of this...)