Unfortunately that can happen, and retraining has to start at scratch, he's still a baby at 5 months old.
When I had puppies because they could not go out doors until they had all their vaccines I had to pad train them first. They were confined to a small area with their bed, food, water, pad, and toys, at 5 months old they were 100% pad trained with NO accidents, and were given free roam of entire home. They had all their vaccines and out door training began. Fed at same time every morning, walked at same time every day. At 7 months old they were 100% house broken with no accidents in the house.
Now that I am home all day I can see where potty training can be difficult if you're home all day with a puppy. Yes, restrict his free space, praise like crazy and give treats when he goes outside, if he eats kibble you can use that as treats, reward for going outside. Patience is a must, remember, he's still a baby. Good luck
__________________ Joan, mom to Cody  RIP Matese  Schnae  Kajon  Kia  forever in my  A House Is Not A Home Without A Dog |