While dogs are natural den animals, not every dog likes being placed in a crate. There are some alternatives that might work better if your dog has anxiety about crating. It may require trial and error to find one that makes your dog comfortable.
Crate training teaches your pup how to "hold it;" the crate is an effective tool that lets you predict when your pooch needs to go, so you can guide him to the correct spot.
Living with any roommate can be a struggle, but furry, four-legged roommates can take your frustration to a new level.