Hello. I'm sorry to hear about your dog.
Given the signs, this is most likely IVDD (intervertebral disc disease). This is where a disc ruptures or herniates in the back pressing on the spinal cord which causes weakness and nerve roots which causes pain. Signs can be as mild as reluctance to walk/ climb stairs to as severe as full paralysis.
Diagnosis is made on neuro exam and then can be confirmed with advanced imaging like MRI, CT or myelogram.
Treatment is based on the stage of the disease:
> Mild weakness/ pain can be treated with strict exercise restriction and anti-inflammatory meds (Rimadyl, Deramaxx) + other pain meds (Gabapentin, Tramadol). Crate confinement for the majority of the day with only short leash walks outside is key, and I like to do this for 1-3 weeks.
> Severe neurologic deficits and paralysis require back decompressive surgery to correct.
It sounds like your dog is going to need some imaging (MRI, CT) to find out for sure what is causing this and then surgery if it's a compressive disease.
I hope this helps, let me know if you have any other questions.