Does he like me?

because he's always talking to me and we're always cracking jokes. The thing is that he's "talking" one of my friends and they've been talking for about a year, the weird thing is that they're not dating yet. Until recently I've only thought of him as my friend but then I kinda looked at him and realized that he was attractive, funny, nice, sweet, and he would give up anything for me. Sometimes he will even walk away from his girl and walk over to me and start talking with me, or when we're at an assembly he will keep poking me and ignore his girl. I know this probably sounds dumb but like in gym when we don't have to do anything and just mess around with basketballs, sometimes there isn't enough for everybody and if I'm standing there without one he'll say "here you can have this one" and give it to me, or when I need to charge my chrome book and he is charging his he will give his charger to me in a blink of an eye. Any way I just kinda looked at him one day and was like wow I really like him, and all of the signs kinda point to him liking me, but he has a girl. I'm very confused wether or not he likes me, and maybe I'm getting these nice gestures confused with a genuine friendship, but I just don't know what to do because I know we have a connection.