It sounds as if your toddler is suffering from emotional stress. That’s because your toddler is used to having you around, and he struggles with detachment when you leave. When you’re home, try playing the peek-a-boo game to help him know that he is OK when he doesn’t see you.
The “terrible twos” is a normal development stage for toddlers that is characterized by mood changes. They struggle between their reliance on adults and their desire for independence. One minute a child might be clinging to Mom or a babysitter, and the next he or she might be running in the opposite direction.
Please also keep in mind that 2-year-olds are undergoing major motor, intellectual, social and emotional changes. Whatever you do, stay calm and either offer comfort or ignore the behavior. You might even try to redirect him with humor. As always, make sure you praise your toddler for appropriate behaviors.