The general consensus nowadays seems to be that being in the head of more than one character is bad. We should be "on the shoulders" or "in the head" of one character, and one character only, if not throughout the novel, then at least throughout a "part" (chapter etc.). Often the POV change (note we have a POV concept,) occurs together with a geographic change - the characters we're following are in different places, experiencing different things.
However, I look at older literature, and find that this is not a universal truth. For example, in Les Misérables, we start the first part with Bishop Myriel. knowing both his thoughts and those of his sister, then we switch to Jean Valjean, then we have all three in the same scene, dipping into the heads of all three.
(I would have added quotes, but I only have the book in French. If anyone can edit in anything relevant, it would be appreciated.)
I say 'dipping into' as most of the time we are not in the head of anyone at all, we're not following any POV, but listening to an omniscient narrator, a sort of reporter who is a person unto himself, who tells us what we should know, and often comments on the occurrences, on the characters, or on relevant history and philosophy.
A more modern example, The Lord of the Rings, still has in the same passage (LotR II, chapter 3 - The Ring Goes South):
Frodo took only Sting; and his mail-coat, as Bilbo wished, remained hidden.
Frodo's POV, since he's the only one at this point who knows about the mail? Or omniscient, Frodo-centred?
Aragorn sat with his head bowed to his knees; only Elrond knew fully what this hour meant for him.
Omniscient narrator, in Elrond's head.
Sam eased the pack on his shoulders, and went over anxiously in his mind all the things that he had stowed in it, wondering if he had forgotten anything
That's clearly Sam's head.
Right in the next scene (same chapter):
At first it seemed to the hobbits that although they walked and stumbled until they were weary, they were creeping forward like snails, and getting nowhere.
Away in the south Frodo could see the dim shapes of lofty mountains that seemed now to stand across the path that the company was taking.
Finally, we're in Frodo's head! He's the MC, right? (Arguments about whether he or Sam are the MC should be held elsewhere, please. Not in the comments either.)
The above examples show that, (unless someone wishes to argue that Hugo and Tolkien didn't know what they were doing,) hearing the thoughts, feelings and knowledge of more than one character in the same scene is sometimes OK. (Is it head-hopping?)
When is it OK? What about the above examples (and other similar ones) makes it OK, whereas it is not OK under different circumstances?
My first thought was that maybe the older novels don't go quite as deep into characters' heads as we do nowadays. But then I saw this is not true: right in Myriel's house, Hugo goes deep into Valjean's internal conflict, to steal or not to steal the silver. Throughout the novel, Valjean's soul is not "dipped into", but laid bare before the reader. Similarly, Tolkien gives us Frodo's (and Sam's) thoughts and feelings, his internal journey.
What is the answer, then?
This question is related, but the answer it has is "head hopping is bad", whereas I am trying to understand the examples where head hopping is apparently not bad.