If the target creature is an illegal target by the time Liliana's second ability tries to resolve, the ability won't resolve. No player loses 2 life. If the target is legal but not destroyed (most likely because it has indestructible), its controller does lose 2 life.

Artwork
Loading artwork…
Liliana, Death Mage
The List · #M21-328 · EN
Nonfoil—Foil—
Card rules
+1: Return up to one target creature card from your graveyard to your hand.
−3: Destroy target creature. Its controller loses 2 life.
−7: Target opponent loses 2 life for each creature card in their graveyard.
Loyalty 4
Mythic · Illustrated by Kieran Yanner
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pioneer Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions