1. Start by sitting.
As odd as this sounds, to build muscle, your dog must sit. That's right. I said, sit. Teach your dog to sit properly with the back legs flexed and your dog's body weight balanced equally in a proper, symmetrical tucked sit.
2. Stand up.
Now that your dog is able to sit properly, teach your dog to stand from that sit. The goal here is to use the hind limb muscles, not the upper body. Practice having your dog sit in front of you and then stand, but without you moving.
3. Back up.
Not back up to the previous step, but literally back up. Teach your dog to back up. The goal here is to have your dog walk backwards with nice, even strides and without arching his back. Try it by having your dog walk between the couch and the coffee table. Now walk into him and ask him to move back to get out of your way.
4. Step up.
Ask your dog to step up. Step up onto the bottom stair. Step up onto the footstool. Step up onto just about anything. Front feet only though. Then hold that position for 15 seconds. Repeat 3-5 times.
5. Walk uphill.
So, find a hill, a ramp, an incline of some sort and walk up it! The steeper the hill, the harder the back leg muscles must work. Now, do it again! And again!