Your boyfriend should consult with his doctor to rule out any problematic heart issues. A serious heart condition are symtoms of shortness of breath and dry cough especially when lying down.
For some insight, the complications of coughing can be classified as either acute or chronic. Acute complications include cough syncope (fainting spells due to decreased blood flow to the brain when coughs are prolonged and forceful) can be an explanation of passing out. Nevertheless, your boyfriend should get a workup on the respiratory and the cariovascular system to rule out a serious medical condition.
Thanks for sharing, and if you have any further questions or comments you are welcome to respond. Take care,
Ken