Responding To Husband’s Behavior

When my husband is with other people like my friends or a mutual friend, he’ll often either seclude himself on his phone or computer and ignore the conversation or sometimes he’ll snap at me or say things that are off putting to others. Essentially he doesn’t act like the person he is most of the time when we’re alone and this really bugs me because I feel like my friends don’t know who he really is and I’m worried that the ones who don’t know us well will avoid wanting to hang out. He tends to soften after he gets to know someone. I’ve tried talking to him about it and he doesn’t seem to understand. I feel hurt and then find myself getting resentful. What’s a better way of looking at this situation?