Why does he act cocky when I show interest?

When I first seen him, he was shy and insecure. He couldn't make eye contact or talk to me unless a friend was with him.
The minute I show signs of interest,
he's confident, he makes me laugh, he can be himself BUT...
he starts to be really bitchy.
he acts cocky, and
plays hard to get with me.

When I act like im not into him,
he's all shy and insecure again.
He walks past me with his head down.
He can't make eye contact.
He's too scared to talk to me unless he's with a friend (again).
Its on and off.
Why does he act cocky when I show interest?
Post Opinion