While in darkness, you are invisible to any creature that relies on darkvision to see you in that darkness.
I want to clarify this part of the rules on unseen attackers and targets:
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.
As I can fire my crossbow and move, do I still give away my location, and do I get advantage on all attacks?