A cardinal rule in correcting problem behavior is: Don’t correct after the fact! In almost all cases, your dog will not associate a correction with behavior that was engaged in five minutes or five hours ago. The so-called “guilty look” is really a response to your tone of voice, your body language, and your dogs’ recognition of similarities between the current situation a previous correction (poop on carpet + owner entering room + owner raising eyebrows + owner approaching dog = punishment). “Repeat performances” are typically a result of not addressing more basic issues such as properly managing the dogs living environment, providing adequate exercise, teaching and rewarding correct behaviors and consistently correcting inappropriate behaviors at the instant they occur.
A special note for puppies: Don’t allow the puppy to do something now, at his or her present size, that you may not want him/her to do when fully grown.