He might be sad or really cold.
It may be sick! Go to the vet immediately!
A shaking and retreating dog could be frightened or in pain.
Sniffing.
It is called shaking or drying off!
he should get fixed
The shaking may occur as a response of frustration to the baby's inconsolable crying or as an action of routine abuse
cause it hurt.
He is probably just tired just let him rest and give him water. Or it could be the results of your dog having cardiac arrest ( the shaking )
A child crying is a potential sign of danger. A dog circling a crying child is a sign of concern - by the dog for the child.
He is cold, possibly?!?!?
Flogging
Shaking the dog won't do any good. The American Red Cross offers pet first aid classes which will help you to deal with an emergency for a dog.