Each combatant gets 1 action, a bonus action if they have a power to use it, a reaction and movement equal to their racial movement ability.
The rogue has way too many actions.
On action 1, do they have advantage or a buddy in melee? If so then they get SA. Action 2 if they have used SA, they don't get it again. Their bonus action is used to make this attack (see note below, this cannot be done with the longsword). Action 3 is impossible as they have no actions remaining. Action 4 is permissible, though it would provoke an opportunity attack. The rogue is left with some remaining movement but nothing else to do.
Also unless your rogue is human, and has taken a feat at L1, it cannot attack with TWF using a longsword. TWF requires light weapons be wielded in both hands.
So we have:
- Action: attack
- Bonus action: attack with off hand weapon
- invalid, both bonus and regular action used.
- Ok, but eats opportunity attack
- invalid, both bonus and regular action used.
It seems the problem you're trying to solve, is how to get consistent Advantage on attacks, without provoking opportunity attacks. This depends on a number of things.
What is the boss's reach? If the boss's reach is longer than 5 ft, then you will not provoke an opportunity attack to move behind your Dragonborn friend, if he is within 5 ft of the boss.
Must you use melee attacks? Using ranged weapons in a different location would be much safer, keeping you farther from the Boss, protecting you from Area of Effect spells or abilities, and giving you Advantage consistently without having to worry about disengaging.
You're also making a few assumptions:
- Hiding means you are completely undetectable. This is false. He can't currently see you, and you have advantage to hit the boss, but for an intelligent creature, it's pretty obvious you're behind the Dragonborn somewhere, and he can still move around your friend to spot you. Additionally, barring the Skulker feat, attacking will reveal you. Also, simply stepping out from behind the Dragonborn will reveal you if the Boss is looking in your direction. (Also note there are no facing rules in fifth edition by default, so this is subject to GM rulings) Note this makes hiding in melee rather impractical without specialized abilities.
- Nimbleness means you can stand in another creature's space. You may pass through another creature's space, but you may never end your turn in another creature's space, unless they are multiple size categories larger than you.
As it stands, the Rogue does not have enough actions to Disengage, Hide, AND Attack in one turn, so he would either provoke an opportunity attack, or not be able to attack. The alternative that would allow Advantage attacks every turn, is to use a ranged weapon, and hide at a distance.
Note, if all you're concerned with is getting your sneak attack bonus, all that is required is either having advantage or an allied creature is within 5 ft of your target. Keep in mind that applies to ranged or melee attacks: so as long as the Dragonborn is next to the boss, the Rogue will still get sneak attack against it.
Unseen Attackers and Targets (Fifth Edition SRD)
Combatants often try to escape their foes’ notice by hiding, casting the invisibility spell, or lurking in
darkness.
When you attack a target that you can’t see, you have disadvantage on
the attack roll. This is true whether you’re guessing the target’s
location or you’re targeting a creature you can hear but not see. If
the target isn’t in the location you targeted, you automatically miss,
but the GM typically just says that the attack missed, not whether you
guessed the target’s location correctly.
When a creature can’t see you, you have advantage on attack rolls
against it. If you are hidden—both unseen and unheard—when you make an
attack, you give away your location when the attack hits or misses.
Best Answer
Technically no. Fifth Edition D&D does not have a concept of facing. So creatures are assumed to be able to see in all directions freely. This would include directly under themselves.
The rules do not allow for creatures to block line of sight, so a creature certainly can't block its own line of sight with its own body. So as far as being obscured by the ogre, that's not possible in RAW 5E.
That said, if I was DMing this game, I'd allow it.
A note about sharing spaces and the justification of facing as an issue here (from comments.)
While the halfling probably can't share the space with the Ogre, the rules do allow the character to break up their movement. Does that mean you can attack/hide in the middle of a movement through the Ogre's space? Could you jump and fire over a short wall? I don't think these are adequately addressed in the rules.
The reason facing matters is that you can't hide from a creature when you are in plain sight of that creature. If you can't be behind a creature, what in the rules says you can be under them and therefore out of view?