Reasoning for squeezing/playing with my inner thigh?

My close friend and I have been talking quite a lot. We both share a class. In one of them, he played with my upper thigh and traced lines / rubbed it lightly. (He started off by just poking it to ask me for consent.) The next day, he did it again but closer to my private area and squeezed my inner thigh. I always thought he liked someone else, so what would be the purpose of this? (It went on for the entire both classes. Also none of this was without him just doing it he gave me a chance to stop i just want to know why he would do so.)
Reasoning for squeezing/playing with my inner thigh?
Post Opinion