Don't live with him. Talk to your boyfriend now, and tell him you can't live with his friend. Tell him WHY. Tell him about the way his friend treats you. Tell him that you do not want to live with someone who has such a shitty attitude towards you, and that you shouldn't be expected to.
Because, honestly? I've done the doormat thing, moving in with a boyfriend's friend who doesn't like me, just because I wanted to live with the boyfriend. And it's really not worth it. I just ended up moving out within the first three months anyway, because I couldn't handle being so mistreated, and having the a/c turned off every single day in 100-degree heat just because the friend felt it was "unnecessary."
And this friend, who didn't want to spend money? Yeah, they ended up using the stuff I bought anyway, no matter what I tried to regulate.
So, I'm sorry to be so blunt, but you shouldn't live with that guy. And if your boyfriend's dead-set on going to live with his friend? Let him. You can visit, while you live somewhere else with people who have respect for you.