Why would a guy start doing this?

My crush used to always look at me and would always try to sit near me. He has been doing this for a while now. But for the last 6+ months he stopped. He doesn’t make it obvious if he is looking. And he also disappears for months before he comes back and act sort of interested. I know for sure he isn’t claiming anyone but this is confusing me. He never comes up to talk to me but seems kind of interested. If I did look at him he looks down on his phone. So I thought he wasn’t interested. Was I wrong? I’m so confused. Why doesn’t he do this to other females?
Why would a guy start doing this?
Post Opinion