From the boisterous puppy that doesn’t realise their play can be painful, to the dog that saves this behaviour only for guests, here’s some tips to protect those ankles!
AVOID WHAT YOU DON’T WANT THEM TO DO!
In the short term, the behaviour needs to be avoided, so that it is not continually reinforced. Sometimes the dog needs to be in another room altogether, or outside, and only allowed in the vicinity with a head collar and lead so that you can ensure there is no biting at, or rushing at your guests feet. Distract him with food or a toy
SHOW THEM WHAT YOU DO WANT THEM TO DO!
In the long term, one approach is to teach him an alternate behaviour. Such as to lie quietly on a mat on cue, and look to you the owner for direction. You may need help with this via obedience classes or a trainer that uses a positive, rewards based approach. Have daily sessions (even 10 minutes), where you practice asking him to lie down and stay, reward him when he’s lying on the mat, and be sure to free him from the stay a number of times in your ‘play’ session. The aim is that when guests arrive, he will listen to you and stay on the mat (and be rewarded), rather than rush at the guests. This will take time and patience. Start this training in unexciting situations without distractions (i.e. in your house without visitors), then very slowly progress to having people he knows well such as family members coming and going, then finally the more exciting situation of guests arriving. Only challenge him with guests arriving when he is doing the lie on the mat really well.