My baby doea this too.
Think it is to make himself comfortable.
He does this only when he is hot especially if he prespires.
If he is lying on the bed for 5 mins in this type of super hot weather even with the fan on, he will start to shake his head. I believe he just wants attention and tells us the message that he is feeling uncomfortable.
Read more