The only way to do it is to hire a professional dog photographer. They go to "dog whisperer" school for 7 years (Ok it's really 7 dog years) to learn the Ninja like tricks of photographing dogs. I know where you can find one...
OK, Nina and Janice can explain it better, and fill in the holes, since they've shot a lot more portraits, but here's the basics. You have a "dog wrangler" who works with the dog, and gets him into position etc. Another assistant and/or the owner get the dogs attention by whistling, holding up a toy or treat, making an interesting noise, whatever works. which can vary from moment to moment.
The photographer, who has already done some test shots to make sure the lighting is good etc, stands by with her finger on the trigger, just waiting for the instant the dog is posed. You don't need long, which is good, since you often don't get it either.
Sometimes with puppies, they'll have several wranglers, they get them ready, jump out of the way and click before they do what puppies do naturally, wander off in random directions etc.
Patience, persistence, and working together all help. Hopefully the dog cooperates, as that's the real factor in the whole thing. Experience helps too of course, and a natural affinity to working with dogs.