Dog's short-term memories will tend to remember the last five to fifteen seconds. This is critical to understanding for training purposes and understanding how your dog will learn from their experiences with you and their environment.
Dogs short-term memory remembers instant consequences
For example, if your dog gets stung by a bee that it was sniffing in the grass, they'll get instant pain (hopefully no allergic reaction) and learn that sniffing a bee is bad and they're unlikely to do it again.
However, if your dog has just run away from you, rolled in some fox poo, run about some more, and then run back to you. All they are thinking about now is "woohoo I'm back with my owner", they will have forgotten that they've rolled in fox poo already. If you punish them, scold them, or put them on their lead without any treats they will associate coming back to you as a bad thing. This is, unfortunately, the opposite of what you are trying to achieve with recall training. In this instance, you have to forget the misdemeanours of running away and rolling in fox poo and reward the return of your dog with treats, rewards and praise.
For completeness, in the previous example, if you want to stop the running away or rolling in fox poo, you need to remove the option by keeping them on a long line and teaching them recall and/or teaching them "leave it" when they get near fox poo.
Puppies have an even shorter attention span!
For puppies, make sure to keep it very simple and mark and reward the behaviour instantly. This can be achieved with a simple "yes" or even better with a clicker using clicker training. Often the smaller members of the family need to be reminded to mark and treat the first achievement; asking a puppy to sit, then lie down, then roll-over without a treat until can make them ignore the first two commands and short-cut to the rollover as they have associated the final behaviour with a treat and the first two are not rewarding!
This means having a clicker and lots of treats to hand to reward quickly. If you don't reward in the first five seconds, your puppy could be learning that rustling plastic bags is good. You're essentially teaching them to come to you when you have a rustling bag and whatever training or trick you've tried to teach them hasn't been reinforced with a reward. In this example the teaching of rustling bags isn't necessarily a bad thing because it can be useful for recall training. However, if you're trying to teach them to sit or lie down, they haven't learnt anything if you haven't rewarded them quickly enough.
Misdemeanours beyond five seconds ago are best forgotten
If you leave your puppy or dog alone for periods of time, whatever misdemeanours they did while you were gone will be forgotten about unless they happened in the last five to fifteen seconds.
If they've chewed up a cushion, sofa, etc and you shout at them in frustration when you get home, they are just associating you coming home as a scary time. Unfortunately, they have chewed whatever they chewed because they were bored or nervous at the time. Unless you can tell them while they were doing it to leave it, they can't associate the unwanted behaviour with a "leave it". They need your help to focus on something you do want them to do, like lie down chilled in their crate chewing on a kong or something similar.
In fact in this example, if your dog is suffering from separation anxiety. You will be making it worse by shouting or punishing them when you get home for any unwanted behaviours. As soon as you leave the door, they will then be associating you coming home as a bad thing and so will never want you to leave.
Focus on what happened in the last five seconds
This is sometimes the toughest part of training a puppy or dog. They've just ignored you in a dog field, they've run away, jumped up at other owners and then they've finally come back to you. Or maybe they've been left at home for just 10 minutes, shredded your rug, shredded their bed. Human nature fitting in with society is screaming at you to tell off your dog so they learn they can't do that. They're not a human though and you must remember that. They will only associate their last five seconds of behaviour with a consequence.
They're happy you're home or they've just run back to you and you need to reinforce that being with you or near you is the best thing ever. The other behaviours need careful management through dedicated training and focus.