Once they were indoors, however, he seemed pleased to see them and allowed them to make a fuss of him. What was that all about?
It sounds as though your dog was in conflict, triggered by the space in the doorway being blocked by the people with their outstretched hands coming (from his point of view) from the darkness.
Doors into houses are important to dogs because all dogs have a degree of instinct to protect their territory.
The turned-away head and lifted lip indicate a well-mannered dog who had recognised familiar people but in a situation that seemed threatening to him.
He therefore offered appeasing behaviour but with the caveat that he would defend himself if necessary.
Once in the house, the people were no longer blocking an access route, no longer in silhouette, and no longer reaching out towards him.
Therefore they were no longer presenting themselves in a “dangerous” situation, and he was able to relax and interact in a sociable manner.