Toilet training a dog is an important matter for both the dog and those he lives under. For the household it is a matter of hygiene; by depositing its wast around a house the canine may be marking its territory but is also creating areas that must be cleaned up or encourage the spread of disease. For the dog it can create its own health issues, especially if it is forced to bed down in a limited area. By properly potty training the dog in question it is possible to not only ameliorate the hygiene issues but also make sure that the canine has a clean area when it sleeps. As such it is necessary to potty train the dog, and using a dog crate can only help.
First off, let us define one term for the ease of conversation: A “dog crate” is simply the container that the puppy uses for sleep. While it can be an actual crate, a movable kennel, or even just a paper box, some of the better crates allow the master to separate areas a needed, such allowing the master to give the puppy an area where it can sleep and where it can eliminate wastes. While this can expedite training, it is not necessary; all that matters is that the puppy has some form of dog crate it can call home and that it can be placed in with little chance of escape. Once that has been established then potty training can be begun in earnest.
When choosing a dog crate try to choose one that is big enough for the adult dog to turn around but just barely. You want the puppy to be have some room but not too much; you want the puppy to be comfortable but if you give it too much room then it may be able to relieve itself and still have room to sleep (read more on this at https://www.thepamperedpup.com/dog-keeps-peeing-pooping-crate/). You also want to make sure that the crate is well ventilated; this will ensure that the puppy will enjoy the crate and enable you to make sure that the crate is comfortable. You also want to make sure that crate can easily be closed and that the puppy will remain inside; if the puppy can easily escape then it may not work for training, where the puppy must remain in the crate for hours at a time.
Before you begin training in earnest make the puppy comfortable in the crate. The puppy should love the crate relatively easily as it represents not only a smaller territory for it to have to worry about but will also give it a chance to escape the chaos of living with a family. Anything you can do to make it more like a den, such as adding a lightweight blanket or a chew toy, will add to its security. Keep in mind that you want to do what you can to make a refuge for the puppy; as such, you want to avoid using the crate as a punishment method to avoid negative connotations in the mind of the puppy.
With all of that done, training can begin. You want to start off leaving the puppy locked in the crate for ten minutes at a time, and expand that time until the puppy is spending hours inside the crate. As soon as you let the puppy out show them immediately to area you want them relieving themselves; this establishes that they need to go there upon release as well as the area where they should be doing so in the future. Reward the puppy every time it goes to the bathroom. Keep in mind that you will need to put up with the dog barking and otherwise complaining about his imprisonment, but that is just part of the training. This should take a couple of weeks.
During the process, which should only take a couple of weeks, you will be dealing with accidents, but take them in stride; eventually the puppy should be going in the given area. Just remember to be patient and you should persevere, and you will be rewarded with a puppy that is no longer going to the bathroom inside your home by the end of it, making life easier for everyone.