Sounds like your dog is just guarding his/her territory. My dog Luc is also the friendliest dog on the planet to anyone he meets EXCEPT when they're in HIS house. Then he barks like crazy trying to protect his home and his people.
Check out this page about aggressive dog behavior to see if you can get some ideas: Click here
T-Gaspard du haut de ses deux ans et demi espiègle, malicieux au centre de ma vie, il rit, il me sourit se cache, il fait des cabrioles. Par l’amour qu’il