Poor little guy
He has no doggy social skills
OK this is what you need to do
Get a friend to go with you outside
Have them with a nice nonthreatening dog on a lead
Have them come into sight distance
and once your dog just sees him ... give him a treat
distract him
have him see the dog again and give him a treat
do this until he starts getting antcy and end the session
.....
a day or two later take it from there
you want to desensitize him
and get the dog closer and closer
Don't try to soothe him when he's whimpering and running away
That just reinforces that bad behavior