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.
Success is usually attained in small steps. Training sessions with your dog should last 10 to 15 minutes, two to three times per day. This is especially true for puppies because of their very short attention spans. Longer sessions can cause an adult dog to become bored. Start by teaching basic commands. Try to stick with one action per training session so your dog does not get confused.
When you have to leave the puppy alone, you’ll need to confine it to a crate. This will prevent the puppy from peeing and pooping all over your home, and will also help teach it control, since it won’t want to soil the crate. However, young puppies need frequent bathroom breaks, so you’ll also need to ask a friend or pet-sitter to stop by and let the puppy out throughout the day until it’s old enough to go for longer stretches without needing to use the bathroom.
Positive reinforcement is the key to success. A common mistake is to punish your dog during training or become angry. This will only cause confusion. You can try to hold your dog's attention with treats and enthusiasm, but know that it is time to end a session when your dog becomes bored or tired. Try to end sessions on a positive note. Eventually, successful training will be achieved with patience and consistency.
Though it differs by each individual dog this is the time when most will come up with their own little way of letting you know they’ve got to go. It might be crying at your feet, ringing a bell you’ve set up or waiting at the door — just be sure to pay attention to these signals & follow up. Once your dog knows how to get your attention when he’s got to go you can relax a little and congratulate yourself on a job well done.