The way I see it, the dog has a different understanding of his position and role in your little community than you or your flatmates have.
Let's call the owner of this dog "Bob".
- The dog is Bob's property and his responsibility
- The dog lives primarily in Bob's room and only ventures into your room occasionally
- You have nothing to do with the dog besides ignoring it
The dog thinks:
- The entire apartment is his territory
- He shares this apartment with 3 humans. Those are his pack
- Bob is his favorite pack member and possibly the pack leader (maybe not)
- You rank lower in the pack than the dog
From the dog's perspective, you all are his family. He doesn't understand and doesn't care that Bob has the sole responsibility for his feeding, training and wellbeing (from a legal point of view). If you live together, you all have to spend some time with the dog to establish a hierarchy.
What causes this behavior?
Some possible causes that come to my mind are:
- The dog is very dominant and bullies you to assert his dominance
- The dog is very insecure and anxious and overreacts by nipping
- He simply doesn't like you
- You always walk on eggshells around him (submissive gesture) which triggers his dominance
To top it all off, any and all of these could be combined in your case. It's very typical for anxious and dominant dogs to display problematic and aggressive behavior.
What could you do?
First of all, you need to talk to Bob. You should explain that the dog's behavior is not acceptable and that you need to train with him to change this. The best possible outcome is that all 3 of you decide on one plan of action and work together at implementing it.
What will not, under any circumstance, be successful is to tell Bob "You need to stop your dog from biting me". Legally the dog is Bob's responsibility, but he cannot magically change him.
The first thing you personally need to do is obedience training with the dog. Ask Bob how he does it (if at all), which commands the dog knows and what kind of treats work best. This should ideally ensure that:
- The dog learns that you give commands to him (you are the dominant one)
- The dog learns to interact with you in a positive way (getting treats)
- The dog trusts you to not harm him
- You trust the dog not to harm you
Do not be afraid to order him out of your room if he misbehaves and nips you. There are rules about living together in piece and if the dog doesn't follow them, don't hesitate to show him the consequences. Be sure not to physically hurt him, though, or his nipping might become real biting quickly.
Once you have built some trust, teach the dog to go into his crate (if he has one) or into his bed (if he has one) on command. Do so every time he barks like crazy because of visitors or Bob coming home. You might have to close the crate or leash him close to his bed. The idea is to put him in a timeout by taking away his ability to run around barking like crazy.
This might not work very well for Bob coming home, because the dog is simply too excited to see his owner again and barking is a natural expression of this excitement.
Maybe you should first tackle the nipping and build some trust between you two. If that situation improved and you still cannot get him to stop barking like crazy, write a new question concentrating on this problem.