Tail Between Legs
He stayed near his humans for security while other dogs came over to sniff and get to know him. He had his tail between his legs even when friendly dogs or humans came near.
He was afraid. A dog puts tail under belly when he is afraid. Mostly only puppies are this afraid, or rather timid, but at times even grown dogs tuck their tails in this manner.
This is such common knowledge that there is a saying that uses it: "with one's tail between one's legs." The saying is spoken of someone who is defeated, cowed, or humiliated.
Here are some examples I just made up using this saying:
After she turned him down at the party, he had his tail between his legs, he was so disappointed.
He struck out in the baseball game yesterday, so today he's walking around with his tail between his legs.
Her tail is between her legs because she was caught with her hand in the cookie jar.