Hiding in battle would be pretty frickin' useless if it was #1 and Rogues would never do it. Rogues are supposed to get Advantage every turn so it should be at 2 or 3.
No, Rogues are supposed to be able to
Sneak Attack every round, and "you don’t need advantage on the attack roll if another enemy of the target is within 5 feet of it" if you want to Sneak Attack. That's an order of magnitude easier than getting advantage. However, there's also now the Steady Aim optional feature if your party is all ranged attackers.
Hiding doesn't "need" to work reliably in combat at all. It "needs" to work when you want to be not seen or heard, such as when you're avoiding a combat encounter entirely. It doesn't need to work when you want to set up an "ambush" less than 6 seconds after you "hid" less than 5 feet from where you very obviously just were
when you did the exact same thing less than 12 seconds ago.
You need to spend an action to hide (bonus for a rogue, standard for everybody else) so even if you move back into darkness you're not considered hidden. They can't see you but they know that's where you are so they won't be surprised on the following turn.
Why isn't that spelled out in the rulebook?! I don't have my book handy but I find it really stupid if it's not. That's not, in any way, a corner case, nor is it something opened to interpretation like the very concept of 'hidden' seems to be.
Because the game's hiding rules are, "it works when it makes sense for it to work and it doesn't work when it doesn't make sense for it to work and the DM is the final arbiter."
The rules have the "hidden attackers get advantage" provision in spite of the "stepping out of hiding ends hiding" provision because there is a potential to attack from a hidden position when you don't have to step out and reveal yourself at all. For example, if you're in a darkened structure during the day and shooting a bow at a target outside in bright daylight through an open window, you don't need to step out of your hiding place to fire a shot. You don't have anything in the way, either. If you're in dense foliage or behind concealment of some kind (e.g., minor illusion), you can also probably make a shot without stepping out of hiding at all, too
.
Hiding doesn't need to work to allow you to repeatedly hide in the same spot round after round to get advantage on your attack roll and to avoid any retaliation against the exact same creatures that are supposed to be as sapient as you are.