Hi Jacobite
I'm sorry to hear that Charlie's behavior has escalated. I'm not as quick to say that it's "just" herding behavior as others. Many shy dogs, who are tense and nervous with visitors, will show aggression only when the visitors' back is turned. This can lead to dogs who 'ankle bite' or bark/nip as people turn to walk away. You mention that Charlie was very fearful when you got him, so that stands to reason that he might be so nervous that he shows aggression. If this is what is going on, Charlie isn't the only one with this problem, you can google and see how many others have asked this question about their dogs.
Charlie has been nipping at people's ankles as they leae. It's like he is saying please don't leae me. We hae been trying to correct him, but now he tried to bite someone in the ankle as they left. Any ideas?
How are you trying to correct him? This may have made the behavior worse; if he's truly doing this out of fear, and he's getting punished, it may just serve to convince him that visitors are even WORSE than he thought, and he had better get them out of the house as fast as possible. He may "blame" the visitors for the punishment rather than himself.
The easiest thing to do would be to leash Charlie and take him out of the room before people say goodbye. You can even go to another room, where he can hear or even see the visitors from a distance, and give him some tasty treats to show him that Departure Time is yum-yum time for him. This trainer also has ideas:
http://www.goldendoodles.com/train_carole/cs_biting_departing_guests.htm
Ideally, you'd work with a local trainer who could evaluate Charlie and decide if this is a fear-based behavior (which I suspect it is) and create a plan for you. If you are interested, you can give your city/state/country and perhaps a member here might be able to give you a referral to someone they know.