Well I do it to a lot of my friends now, in order to make it seem normal, but at first I only did it to the few girls I really liked, and now its just a bad habit.
But everything really depends on the context of how he's doing it, for instance if you guys are walking side by side and talking and he suddenly wraps his arm around you and pulls you closer its because he likes you(most likely).
or if your with a group of friends and your talking to someone else and he does it its because he is to some extent jealous that that person has all of your attention and wants it for himself, in short it means he likes you and wants you for himself.
but if its just a casual sort of resting it there then he probably is more likely to just be being friendly.
Maybe he wanted to see how you would react to him making a move without having to verbally do so because if you didn't like it then you could have showed him that you don't have the same feelings for him that he might have for you. None of my guy friends that I barely talk to would do that so he defientley has a bit of a crush on you. Doesn't seem like you pulled away so if you have feelings for him then this is a good sign!