The number of cards you discard and the amount of life you gain are both equal to the number of Zombies you attack with, even if you draw a different number of cards somehow.

Artwork
Loading artwork…
Varina, Lich Queen
Secret Lair Drop · #861 · EN
Nonfoil—Foil—
Card rules
Whenever you attack with one or more Zombies, draw that many cards, then discard that many cards. You gain that much life.
2, Exile two cards from your graveyard: Create a tapped 2/2 black Zombie creature token.
4/4
Mythic · Illustrated by Igor Kieryluk
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Varina's first ability counts the number of Zombies you attacked with, even if some of those Zombies leave combat before the triggered ability resolves.