You and your player may be overlooking some things about how Stealth and hiding work. You should both read The Rules of Hidden Club, which explains both comprehensively. It's an excellent guide, and the official rulebooks don't explain it nearly as well.
Bear in mind the Stealth rules in the first Player's Handbook are broken and incomplete. They're repaired and amended in the Player's Handbook 2 on page 222. You can read the updated rules in the Player's Handbook update PDF from the D&D 4e Updates and Errata page.
If your Rogue player wants to hide, merely standing far away is not good enough. They have to meet several other conditions, too. Quoting Hidden Club:
How do you become Hidden? You roll Stealth at the end of any Move Action or any of your Actions (even Free Actions) during which you move.
"Move" is defined in the PHB3 glossary as, roughly, to leave one square for any reason to enter another square. You can't roll Stealth after Forced Movement since that's not your action. You CAN roll Stealth after a granted Free Action.
You must also meet three requirements:
- You must not be visible, which means Total Concealment or Superior Cover, at the end of the move.
- Your Stealth roll must beat the Passive Perception of anyone you want to be Hidden from
- You cannot have HAD Hidden at the start of the action and lost it during the action. Which is to say, you can't BECOME Hidden as part of the same action that loses your Hidden state.
By the way, any time you become Hidden, record the number you rolled. It's important.
In addition, your Rogue player may incur a penalty to their Stealth check for the move action they're using to become hidden. Quoting PHB2 p222's Opposed Check entry in the Stealth skill:
If you move more than 2 squares during the move action, you take a –5 penalty to the Stealth check. If you run, the penalty is –10.
Once you're Hidden, it's not as simple as just staying that way. All your Rogue's enemies still know where they were before he became hidden, and he still has to follow the Rules of Hidden Club (as described in that page I linked) in order to stay hidden. For example, he has to maintain at least cover or concealment from any enemy, or he is no longer hidden from that enemy (who can then immediately inform the others).
So: get reading!
As you have analyzed in detail, there is a disconnect.
Effectively, we have two ways to use the Hide skill. One is the way it is usually (sic) done - as part of another action. Another is Sniping, which has its own action requirement.
However, since the first option allows hiding as part of an attack (note: an unspecified, general, attack), it encompasses every instance in which we might want to use the Sniping option. Since the Sniping option has an additional action requirement, it is useless, eclipsed by the "usual" method of hiding.
To answer your specific question: Yes, should combatant A foolishly decide to use the Sniping option of the Hide skill, combatant B automatically sees them, as A does not have the actions required to hide.
I suggest resolving all situations involving sniping using the "usual" rule (the one you described in Example 2). The sniping rule is broken.
Best Answer
No, this doesn't work in melee.
At least not the important second half.
No, they can't just pop back out and sneak attack. To sneak attack, they need advantage, and to get that from being unseen they have to still be unseen when they attack (PHB, p. 195):
Unfortunately for the rogue, as soon as they pop out in front of an attacker that's already aware of their presence, they are immediately seen and no longer count as unseen when they attack (PHB, p. 177):
Sneak attack only works if they sneak up on an enemy who doesn't know they're there. Popping out of hiding isn't sneaky, unless the enemy is surprised — and they can't surprise an enemy that is “aware of danger”. When they duck behind a corner in combat, the enemy is aware of danger and watching all around, and is impossible to sneak up on (without unusual circumstances), because that enemy is the opposite of surprised — they are actively on guard.
Does it work at range?
Not easily. It can work as long as they avoid being spotted, but not being spotted is the hard part: since the attacker's location is automatically given away and after that it's easy to see them, special precautions are required to prevent being seen despite the target knowing exactly where they are.
To do that at range you're working with the same rules — they need to be unseen, they need to stay unseen until after they make the attack, and the target needs to fail to locate them after being attacked. It's that last part that makes this difficult — by an explicit rule, attacking reveals a character's location (PHB, p. 195):
So to make this work at range, they need to arrange fictional circumstances somehow to defeat that. The usual way to do this with ranged attacks is to
This convoluted process is often necessary because, at step (1) the ranged attacker has already revealed their location, and all it takes is a successful Perception check to see them (assuming the attacker is not blindingly obvious once the enemy knows where to look) for the advantage from being unseen to be removed. Steps (2)–(5) establish a new location that has not already been revealed, allowing the next attack to be made unseen.
(However, this process can be largely skipped if the hiding spot is so good that Perception checks to see the attacker are likely to fail. To be a good sniper, make a good sniper nest! And hope you're not seen, and have an escape route planned.)
But popping out from hiding in a single location before attacking? No, that won't grant advantage, because just like in the melee situation, the attacker is immediately seen once they move out from their hiding spot to line up the next shot.
Ugh, this is too hard!
Well then, do it the simple way: an enemy that has an ally of the rogue's adjacent to it can also be Sneak Attacked. That allows Sneak Attack every round with no need to fiddle with movement or hiding or seen/unseen variables. Just flank and shiv.
1. This post uses “cover” in the dictionary word's tactical sense, to describe the activity happening in the game fiction. Whether that cover is mechanically represented with Obscurement (PHB, p. 183) or Cover (p. 196) will depend on the exact circumstances as adjudicated by the DM on the scene, as is appropriate.