It's not so much the dog doesn't listen, more that he doesn't understand what you want him to do. Go back to basics and don't punish him when he toilets indoors. Double your vigilance and take every opportunity to put him outside to toilet. The crucial thing is to be present when he does toilet in the correct place, so that you can reward him. This makes him keener to repeat the performance to get another treat. Conversely, if you have been telling him off for indoor accidents he may already feel inhibited about going to the toilet in your presence, including when he goes outdoors. This is one reason why it's important not to punish for inappropriate toileting.
It's very important to put your puppy on a regular and timely feeding schedule; What goes in on a regular schedule will come out on a regular schedule. Every pup is different; some poop immediately after eating; with others it may be 30 minutes to an hour after eating. Unless advised by your vet for some medical reason, do not free-feed. That is, do not leave food out all the time. For two reasons: First, your pup's elimination schedule will be random at best. And second, she will not necessarily associate you as the provider of her food (see our article on being a pack leader and winning a puppy's respect and trust).

A Hungarian dog training group called Népszigeti Kutyaiskola use a variation of model-rival training which they describe as the Mirror Method. The mirror method philosophy is that dogs instinctively learn by following the example of others in their social sphere. Core to the program is including the dog in all aspects of the owner's life and positive reinforcement of copying behaviors. Mirror method dog training relies on using a dog's natural instincts and inclinations rather than working against them.[71]
Based on the principles of social learning, model-rival training uses a model, or a rival for attention, to demonstrate the desired behaviour.[69] The method was used by Irene Pepperberg to train Alex the African Grey Parrot to label a large number of objects. McKinley and Young undertook a pilot study on the applicability of a modified version of the model-rival method to the training of domestic dogs, noting that the dog's origins as a member of large and complex social groups promote observational learning. The model-rival training involved an interaction between the trainer, the dog, and a person acting as a model-rival, that is, a model for desired behaviour and a rival for the trainer's attention. In view of the dog, a dialogue concerning a particular toy commenced between the trainer and the model-rival. The trainer praised or scolded the model-rival depending on whether the model-rival had named the toy correctly. It was found that the performance times for completion of the task were similar for dogs trained with either operant conditioning or the model rival method. In addition, the total training time required for task completion was comparable for both methods.[70]
Strictly following the model set out in the Koehler Method of Dog Training, some 50 years later, the Koehler method continues to be taught in both class and private training formats. The method is based in the philosophy that a dog acts on its right to choose its actions. Koehler explained that a dog's learned behavior is an act of choice based on its own learning experience. When those choices are influenced by the expectation of reward, the behavior will most likely be repeated, and when those choices are influenced by the anticipation of punishment, they will most likely cease. Once the dog has learned that its choices result in comfort or discomfort it can be taught to make the correct decisions. Action→Memory→Desire encapsulates the learning pattern used by the method; the dog acts, remembers the consequences, and forms the desire to repeat or avoid those consequences. Adherents believe that once the behavior has been correctly taught, it should be performed, thus making any correction, fair, reasonable, and expected.[60] While the model has been used consistently since 1962, some of the punishment procedures described in the book are now not considered necessary, humane, or appropriate by many trainers.[25]
While working with a dog, Millan often uses vocal marks such as tsch,[33] gestures, and body language to communicate with dogs rather than speech or the dog's name. Millan encourages owners to create their own unique sound that works for them.[32] He believes that dogs sense, understand, and respond to a person's energy more easily than their speech.[34]

It’s best not to punish the puppy for making a mistake. Instead, focus on praising appropriate bathroom behavior. If you catch your puppy in the act, interrupt it by saying “No!” in a firm voice or clapping your hands loudly, then take the puppy outside to finish going to the bathroom. Never swat your puppy, yell at it, or try to rub its nose in the mess.
Consistency and Patience. Never scold or punish your puppy for mistakes and accidents. The older your pup gets, the more he will be able to control his bladder and bowels. Eventually your pup will have enough control that he will be able to "hold it" for longer and longer periods of time. Let your puppy do this on his own time. When training is rushed, problems usually develop. Don't forget, most puppies are not completely house trained until they are 6 months old.

Prior to the 1980s, Karen Pryor was a marine-mammal trainer who used Skinner's operant principles to teach dolphins and develop marine-mammal shows. In 1984, she published her book, Don't Shoot the Dog: The New Art of Teaching and Training, an explanation of operant-conditioning procedures written for the general public.[25] In the book Pryor explains why punishment as a way to get people to change often fails, and describes specific positive methods for changing the behaviour of husbands, children and pets.[35] Pryor's dog training materials and seminars showed how operant procedures can be used to provide training based on positive reinforcement of good behavior.[25] Pryor and Gary Wilkes introduced clicker training to dog trainers with a series of seminars in 1992 and 1993. Wilkes used aversives as well as rewards, and the philosophical differences soon ended the partnership.[36]
Clicker training, a common form of positive reinforcement, is a simple and effective dog training method. Although it is still fine to train your dog without clicker training, many people find it helpful. With clicker training, you can easily and effectively teach your dog all kinds of basic and advanced commands and tricks. It's fast and easy to learn how to clicker train your dog