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:

1. Action: attack
2. Bonus action: attack with off hand weapon
3. invalid, both bonus and regular action used.
4. Ok, but eats opportunity attack
5. invalid, both bonus and regular action used.