Re: crate training/whining through the night
Hmmmmm......Ours got pretty settled into a night routine after a few nights with us. But Loki came *somewhat* crate trained. Did you just get him? I would recommend keeping the crate near your bed, if you have, for a little while at least.
At 5 months, you should be getting close to the stage where you won't need to take him out to potty in the middle of the night. But, certainly by now you'll only need to take him out once. When you do take him out to potty, make sure you take him out on a leash so he doesn't play and don't give him any attention whatsoever. As soon as he does his business, take him right back into crate.
I'm also going to assume you've gone through the crate training routine and don't just stick him in there at night when he doesn't usually spend any time in the crate without having been acclimated to it first. I also assume you pay him no attention when he is whining/barking. If you do, this will only encourage/condition him to whine more.
I'm not sure what other advice to give! Good Luck!