Why my crush rub his ass to mine?

We were in food and nutrition class, we were prepared something as a group, then he started flirting with me, i don't know why he did this in every food and nutrition class, like rub his ass towards mine as or block my way on purpose. The only thing that confuse me, is that, every time he done flirt with me, he always leaves but stare at me in a distance or skip the rest of the class or being around some girl he never talk to or interested.
Why my crush rub his ass to mine?
Post Opinion