My name is ***** ***** I’ve been involved professionally with dogs in the health and behavioral fields for over 18 years. It will be my pleasure to work with you today.
She doesn't want the visitors in her territory. Since she is little dog, she may feel scared to confront them from the front so instead sneaks up behind them to nip at them and scare them away. This can be corrected with a few changes. One is going to be obedience training.
The following site is helpful in helping owners train their dog. Be sure and click on the link to the page on obedience at the bottom. and links on subsequent pages leading to detailed instructions.
Training works best if you train at least 30 minutes a day (two 15 minute sessions). I would start making your dog work via the Nothing in life is free program (NILF). It is outlined below.
You will want to start teaching her to sit at the door and wait for your command before moving. This requires a good "SIT" where she stays in that sit position until you give a release command which allows her to come to you. With this you have her sit at the door and do not release her until your visitors are seated. Then you call her to you and have her sit or lay down there where she can see the visitors but not sneek up on them. You can have the visitors give her small treats so she starts to see visitors as good things and not threats.
Some experts will suggest crating him any time she exhibits the ankle biting behavior so she learns it is unacceptable. If you have someone they try to do this to on a regular, this person could be elected to help with training allowing you to work with her several times a day when you know they would normally do it. Once they stop ankle biting, reward them with tasty treats and praise. For each person she doesn't do this to, reward them. She will learn that strangers mean treats and are a good thing and that should help stop the biting.
In addition, if you are present when this is occurring, you can give a correction using the attached leash(good reason to keep it attached) when she looks like she wants to sneak up behind them. A quick tug and firm NO will help teach her that you find it unacceptable.
When first teaching her to sit at the door when visitors come, you can slip the leash under your foot, have her sit and use the leash to keep her in that spot in a sit or down position as you open the door. Initially she will fight it, but soon will realize it doesn't do any good to try and move away and will stay. When she does that reward her. Have visitors reward her as well.
For nipping at the pants legs, you can have visitors you trust adopt an exaggerated walk with the heals coming up on the back swing. If a person walks in this manner, when the dog gets too close to the feet, they will end up getting the shock of a heel coming up and possibly catching them in the jaw or chest. Since the person isjust walking, it will surprise them. It usually only takes a few times before they stop jumping on the backs of legs or biting them.
The obedience training is going to help the most so work on that first and keep a leash on her to help control her when visitors are there. It may take her a little while to learn what behavior you do want her to display when visitors come. In most cases, it only takes a few weeks of daily training to help correct this type of problem.
I hope this information is helpful to you. If you would like any additional information or have more questions please don’t hesitate to press the reply to expert or continue conversation button so I can address any issues you still have . If you do find this helpful, please take this opportunity to rate my answer positively so I am compensated for my time.