Definitely the child is in pain .he most likely must be suffering from ear infection
as he was pulling his ears .his ear needs to be examined if otoscope
examination reveals congested tympanic membrane ,and if ther is a history of cold
then most likely it is otitis media
...even if he doesn't have cold then in some babies who are bottle fed in lying down posture there is high possibility of milk trickling in the middle ear due to straight euestachian tube so there is a possibility of infection in middle ear.