Dogs are predisposed not to spoil at home. Therefore, it will take only time and patience to train a puppy to the toilet. Small breed dogs can be trained to cope with litter boxes. Large ones need to be taught to go to the toilet on the street.
Since puppies pee and poop about 10-15 minutes after eating, you just need to watch your pets. If you are tray-training, after this time, plant your baby on the tray. If you want your dog to defecate outside the house, take your puppy outside. When he pees or poops, be sure to praise. After a while, the animal will get used to it and will go to the tray or ask to go outside.
You can first keep a small puppy in the confined space of the apartment. Then he will understand that this is his house, and the dogs try not to spoil at home. The puppy, as in the first case, must be taken outside after sleep and food (put in a tray) and praised when he does his business there. This method is good because the kid will quickly figure out: the street (tray) is the only "not home", and there it is necessary to shit.
If your puppy shits in certain places, notice them and put a newspaper or rag there. First, it's easier to clean this way. Secondly, when the puppy gets used to going to the toilet for newspapers or rags, these newspapers or rags can be put in the tray. It is better not to put it right away, but gradually move it towards the tray or the front door. If you are trying to get your needs out of the apartment, then you can take the newspapers outside. Let the puppy out into the corridor, and when he starts looking for the newspaper, take him outside.