Why is he such a jerk?

So there is this guy and he is a complete jerk to me. Some of the things that he does; he will fault out tell me whatever I say is stupid, if I look at him he will just stare me down and glare and then start to laugh, every time he burps he will say oh that was for you, he knows I take pride in being smart so he always tells me that I'm stupid, one night I pulled up next to him and some friends at sonic when I was with my friends and he rights in the fog on the window I hate you with my name under it and then jk oh but only kinda, I told him how someone cracked an egg on my car and he said all this stuff about how he wished that he had done it and all of this jerky stuff. I don't know why he acts this way? But its so confusing because sometimes he can be really sweet and nice, examples; if I'm upset then he will try to make me feel better, if I need help he is always really nice and tries to help me, sometimes he will just randomly hug me, he always says hi to me like I will be sitting in a group of people at a restaurant of lunch and he knows all of them and will walk by and say hi to only me, last year he told his pastor all about me so that was weird, I went on a church trip with one of my friends that goes to the same church as him and the entire time he hung out with me and kept jokingly hitting me with pingpong balls, every time I have a stupid question and text him he always answers and puts all of these smiley faces in the message, and he loves to talk to me about how he wants to go to the same college as me, oh and in chem class I will be doing the experiment and he sometimes he will lean over me from behind me or just sit super close. So does anyone know why he acts like a jerk and then acts super nice. He acts like a jerk to pretty much everyone but he is way worse to me but then he will try to be the sweetest guy and it never makes sense to me why when I'm in a big group of people that he knows he only says hi to me. My moms theory, OK I know that sounds super lame, is that he likes me and just doesn't know how to approach me or is intimidated by me, but I'm not sure. What do you think?