Unfortunately I am only DMing 5e.
How I ruled it lately:
1) shooting without losing stealth: impossible, unless special ability says so (feat, spell, ...)
2) leave cover, shoot, move back to cover, hide: only works if the rogue has more than
one place to "re-appear", depends on terrain and...