I am sorry to hear you are worried about your dog. I am a veterinarian and will do my best to help.
When he is doing this, is his mouth open, or closed? Does he make nose when exhaling, inhaling, or both?
If you look at his gums, are they pink in color? If his gums are pink, he is getting enough air and oxygen. If his gums look pale, then he is genuinely having difficulty getting air and oxygen in and carbon dioxide out.
Does he look or sound like this at all?:
This is called "reverse sneezing", and sounds like the dog is dying, but is actually not as bad as it sounds. Dogs do this to clear their sinuses, or if they have an irritant or someting allergic in the nose.
If it is not reverse sneezing, it could be heart disease, bronchitis, or a condition we see in older dogs, especially Labs, called "lar par" or laryngeal paralysis. Here is a video of an older lat with lar par:
Let me know what else I can answer or help with.