Unfortunately when the Big D kicks in, it happens fast with these guys. A crate will not help in this case, because if the diarrhea kicks in, you'll just have a crate to clean up.
I agree with Onrushpam that there is something else at play here.
Do the simple stuff first - Rule out Worms / parasites, get to the root of the stomach issues with your vet, secure the food in a closet or other area that he has no access to, and it sounds like a turnout or long walk before bedtime is essential. Keep him out there until he goes. Make that part of his routine without fail.
These things are not fun for you, but they are better than what you are waking up to.
Others will chime in with additional suggestions. Many have been through similar issues, and will be able to tell you what has worked for them.
Good luck.
Edited to add - just saw your other post regarding the cat food. Do you have an area where the cat 's food and water can be kept and have them use a cat door or opening in a door or gate that only they can get through? That's probably the only way to absolutley keep him away from it.