This could be due to exertion headache, which presents with head pain during or following physical or passive exertion, including sneezing
, coughing, and even bowel movement. This is usually associated with migraine or cluster headaches. However, you need to have this checked by your doctor or be referred to a neurologist for proper diagnosis and to rule out organic diseases like aneurysms or blood vessel malformation. Take care and do keep us posted.