I don't condone being rude but I do understand how it feels to be almost paralysed with nerves in a social situation. I hasten to add that I have never walked away from people but I do find it a tremendous struggle to "put on" and "keep on" a smile, particularly in a larger group - i.e. a party, and I really struggle with so-called small talk ..... I just don't have that skill at all, and I do worry when there's a lull in conversation that people think me rude too because I can't think of anything to fill it in with.
I do actually love good conversation & can talk for hours, but it's getting started that I find so hard. In my experience the cliched "openers" about weather, knowing the hosts, the journey to the venue and what you watched on TV last night are pretty much dead-enders.
I'm actually very short sighted and even with lenses/glasses often find it difficult to "read" people's expressions properly - unless I'm very close. Now I'm not saying that that's an excuse, but when we communicate it's not simply a question of hearing ..... and somehow, not being able to focus properly does affect me.
I know that my eyesight has caused (minor) problems in the past when I've walked past people in the street without saying hello ... it would be easy for them to assume I'm stuck up, particularly if they don't know me very well.
You ask why your H can sometimes do it, and sometimes can't ...... well, sometimes for me, I find social events "easier" than I expected simply because there's someone else there with whom I find I have a chemistry - and by chatting to them, and relaxing, the rest of the evening then becomes easier.
You also mentioned that when you had friends "over" (as opposed to going out) that DH was far more responsive. I'm the same .... I much prefer to socialise in small groups - and preferrably at home (mine or theirs) or where we're sat round a table sharing a few drinks or having a meal. This goes back - for me - to the eyesight thing ...... and when there's a defined group, it's so much easier to get into interesting and "easier" conversation. At parties, receptions etc., no-one seems to stand still for very long, often there's not enough seats to go round (or it's deemed "rude" to sit down even if your back and/or feet are killing you) and people flit about, to my mind, and in my experience "going through the motions" (i.e. "small" talk) without ever really wanting to get involved in anything thought provoking.
I wouldn't actually describe myself as shy ..... I don't know how I'd describe myself. I don't mind meeting strangers - so long as it's in a small group where we can really get to know each other & where there's no pressure to "work" the room. I'd be quite happy to go along for a meal at a collegaue of DP's who was a stranger to me or vice versa, but would feel very nervous at the thought of having to meet them in a crowded place.
At the end of an evening like that, I often wonder "what the heck was the pointy of that" .... I have an aching back, I stink of smoke, have kept a false smile painted on all night and haven't had any decent conversation because, it seems (I'm sure it isn't true of everyone) that at a party, most people do not want to spend very much time with just 1 person.
I can fully understand you wanting to share friends with DH but as he seems to be able to cope with socialising at home far better why not introduce them at home 1st ?