Herding is a natural instinct for many breeds of dogs, such as border collies and cattle dogs. Because they were bred to do it, it's difficult to eliminate the behavior completely. However, when your dog begins herding you or your guests, you may wish to teach your dog what you would like him to do instead, reducing unwanted herding.
Meet Your Dog's Needs
Herding dogs have a lot of energy -- and an impulse to herd -- so it's important to get your dog proper exercise and mental stimulation. Young herding dogs may need to run for more than 45 minutes per day, so take them on runs or throw the tennis ball for them. Giving them an outlet for this energy will reduce problem behaviors in the home.
Make sure that you treat herding the same way each time it happens so that your dog learns. If you sometimes allow herding and sometimes get angry, this confuses your dog. Stop your dog from herding people every time it happens. Even if you practice proper herding with your dog, this will not stifle the instinct.
Teach an Alternate Behavior
What would you like your dog to do instead of herd? Lie down? Heel? Teach those commands. So often we just yell at our dogs for not doing what we want, but we don't teach them a desired behavior.
If your dog often herds guests, a great behavior to teach is go to your mat. This is incompatible with herding because it sends her away from your guests and to a calm place. To teach this, toss a treat on your dog's mat. When she gets to the mat, reward her for being on it. Use your body or a leash to block her from leaving when you say it's OK.
Use a leash when introducing this behavior around new guests. You don't want your dog to learn to ignore the command, and she probably will be faster than you when trying to herd.
You also could teach your dog a fun game, like how to pick up their toys and put them in their basket or how to find objects and bring them to you. Herding dogs are clever. Put them to work.