Man, so many people get this wrong (especially by defaulting to earlier e rules). I tend to think they're OK, but they come across as better in play than in words on a page.
The meat of the scenario is this:
Any character or monster that doesn't notice a threat is surprised at the start of the encounter.
That means noticing
one threat is enough to inocculate you against any surprise.
Example scenario:
The PC's are on a boat and 4 water elementals are coming up to them. The party consists of a ranger who is moving along shore next to the boat, sneaking through the underbrush. Water elementals are "stealthed" because they can't be seen against the water, as is the ranger. DM rolls 4 Stealth checks, one per water elemental, and compares them to the party's Passive Perception scores. They also ask the ranger to roll a Stealth check and compare it to the elemental's perception. DM determines that since the water elementals are trying for an ambush, they're the ones trying to gain surprise, but the ranger can't gain surprise since the elemenals notice "a" threat (namely, the entire rest of the party). This would be why moving off on your own as a stealthy character is a Good Idea.
Lets say the party has passive perception of 9 (foolish wizard), 10 (jack-of-all-stats bard), 13 (veteran warrior), and 15 (keen-eyed ranger). The ranger's stealth comes up 16.
The DM's stealth checks come up, lets say, 11 (elemental A), 12 (elemental B), 14 (elemental C) and 18 (elemental D). They've all got passive perception of 13.
Everyone rolls initiative:
Elemental D - 19
Keen-Eyed Ranger - 17
Foolish Wizard - 13
Elemental B - 11
Veteran Warrior - 8
Elemental C - 5
Jack of All Stats Bard - 4
Elemental A - 3
Turn proceeds like this:
- Elemental D is first. It is not surprised - it sees the party and notes them as a threat. It is hidden, though this doesn't give it any inherent advantages aside from not really being a target. It doesn't see the ranger, and the ranger doesn't see it. It readies an action to attack once someone comes within reach.
- Keen-Eyed Ranger is next, and she sees three elementals. The ranger is not surprised - she sees a threat. She gets to act normally, but she doesn't notice (and so can't target) Elemental D. Since Elemental D also didn't notice the ranger, that elemental isn't going to get their readied action when the ranger passes by them - they don't notice the ranger. The ranger attacks some other elemental, and at that point, they are revealed - elemental D wonders where they came from so suddenly!
- Elemental B's turn. Elemental B is hidden from the bard, and the wizard, but not the ranger or the warrior (not that the elemental would necessarily know that). It attacks the wizard and hits - BARELY. The wizard player perks up - "Oh! Shield!". Unfortunately, the wizard player didn't notice ANY of the elementals - they are surprised and cannot take reactions...yet.
- Wizard's turn. Well, they're surprised - they saw no elementals - so no actions, but now at least they can use shield!
- Elemental C's turn. It is hidden from the wizard, the bard, and the warrior. It goes for the warrior who happens to be a battle master who knows parry. If the warrior was surprised, they couldn't use Parry, but lo, the warrior noticed two of the elementals, and so is not surprised. PARRY. Elemental C was hidden from the warrior but, again, that doesn't confer any particular inherent advantage aside from not being targeted. Elemental C is not hidden anymore.
- Warrior's turn. It saw two elementals, and now a third one that just walloped it. It goes for that one, but as it adjusts its stance it passes within range of Elemental D, and gets walloped as that elemental uses its reaction.
- Elemental A's turn. It is still hidden from the wizard and the bard...and attacks the bard! The bard failed to see even one threat, so they're surprised, too. Not that it does much in this case - the bard doesn't have a reaction beyond an OA, and the elemental doesn't provoke.
- Bard's turn. It stops being surprised.
- Elemental D's turn again.
In that whole scenario, only two characters were surprised.
Some big things:
- If you notice ANY one creature, you are not surprised. So one with stealth won't achieve surprise for the entire group unless they are alone.
- Surprise ends after your first turn - you still roll initiative and have turns normally when surprised, you just can't take any actions (including reactions) until you are not surprised anymore.
- Only individual class/monster features give you advantages when attacking a surprised creature. Otherwise, your main advantage is that they can't take OA's, letting you hit-and-run.