Is it a rescue dog?, or has it had an owner before you?, its behaviour could be down to how it was treated prior to you, but whichever, you should consider a training school. Best of luck.
It could also be something to do with the dog not recognising the person as a human being. Dogs tend to see the outline of a person first from a distance and anything which intereferes with that outline confuses the dog's image of a person. This is why a lot of dogs bark at people with hats, big bags (postmen) and buggies etc.