When a dog is panting and won't lie down, this can be a sign of distress.
Please have your dog though see your vet at soon as you can so to prevent suffering or progression to something potentially dangerous.
If your dog shows other accompanying signs, mention them to your vet as they can help him/her vet more easily pinpoint the problem. Below is a brief list of possibile causes for this behavior.
Dogs may pant and refuse to lie down when they are having trouble getting oxygen. Lying down is a position that makes things more difficult.
Possible underlying causes of respiratory problems in dogs include heart problems, lung infection and tracheal collapse.
Dogs with respiratory problems may not get enough oxygen and therefore their gums may be very pale or slightly blue, something that requires seeing a vet as soon as possible.
A Painful Condition
A dog panting who won't lie down may be suffering from a pinched nerve in the neck or spine or the dog may be suffering from severe arthritis of the dog's joints.
Virtually any type of pain that interferes with normal movement and locomotion can lead to these signs.
Issues With Abdominal Problems
Abdominal issues may stem from eating something unusual or there may be some underlying problem of some internal organ.
When a dog has some sort of abdominal pain, being cramping or acute pain, it's reasonable for him to be reluctant to lie down on his abdomen and the pain may lead to increased respiratory rate and panting.
Bloat is a medical emergency that can cause retching, panting, restlessness and may lead to death if left untreated as the dog's bloated belly may flip on itself.
Problems With the Heart
Issues with the heart can lead to dogs being uncomfortable in lying down. When the heart fails to work properly, excess fluids in the abdomen may accumulate causing trouble breathing.
A Matter of Anxiety
On a much lighter note, sometimes dogs may pant and act restless when they are anxious. The panting and reluctance to lie down may stem from emotional arousal and the overall inability to relax.
A dog may be fearful of distant noises, or may panic when left home alone. An older dog may also be restless and panting if suffering from "Canine Cognitive Dysfunction" which is similar to the Alzheimer's disease seen in humans.
The Bottom Line
A dog panting that won't lie down is a quite vague sign that isn't suggestive for any one particular disorder (pathognomonic).
Your best bet is to have your dog see the vet sooner than later considering that signs may be symptoms of potentially life-threatening disorders.