Completely normal behavior (depending on the age of the child, it may be more severe)!
When our 3.5 year old is acting up, my instinct is to correct the behavior, and in the majority of cases I do. Sometimes, I just look at him and ask what he needs. More often than not, he needs Mommy to hold him, give him more attention, play with him, and he doesn't know how to articulate it.
Especially in the toddler/preschool years, they're beginning to learn who they are and what their limits are. We're just like them - we act differently around different people and in different social situations in which we're more comfortable.
I'd recommend asking him what he needs when he starts doing it and then correcting the behavior as appropriate.
Good luck! You are not alone.