Potty training?

My puppy has been doing SO good with potty training and all of a sudden he's started peeing and pooping in the house. Sometimes he'd have a pee accident if I forgot to take him out but now he's peeing and pooping right after I bring him inside from being out.