Eliminating in the crate is a nasty habit, and if you don't help your puppy break it now, it will be harder to do so when he grows up. The most common reasons for eliminating in the crate are easily fixable, you just have to put in the time and effort. All dogs rely on their owners, but puppies especially, and if yours doesn't get the attention that he needs, he might think that eliminating in the crate is his only option.
Take your puppy outside to eliminate frequently, especially after eating. Puppies usually have to go about 30 minutes after a meal, so take yours out accordingly. Because of their tiny bodies, they can't hold it in very long, either -- your puppy may be eliminating in the crate because he's staying in there too long. Do your best to take him out every three or four hours -- if he resists eliminating outside, you may have to take him out as often as every 30 minutes. The ASPCA advises that while a 4-month-old puppy can stay crated overnight for as long as six hours, he probably won't be able to hold it that long during the day.
Keep the crate small. A puppy should be able to walk into his crate, turn around and lay down -- that's it. If you stick your pup in a crate much bigger, he may treat one end like the bathroom and the other end like the bedroom. Small crates discourage that type of behavior, because dogs instinctively loathe to rest where they eliminate.
Store the crate in a high-traffic area. If you keep the crate isolated from you or your family, your puppy may get stressed and lonely. Separation anxiety can drive the pup to eliminate in the crate, so keep him calm by placing the crate somewhere like the living room, where he can spend time with you even when he's crated.