Celestine's triggered ability looks at the total amount of life you gained to determine X, regardless of whether or not you also lost any life. For example, if you gained 3 life this turn, X is 3, even if you also lost some amount of life in the same turn.

Artwork
Loading artwork…
Celestine, the Living Saint
Warhammer 40,000 Commander · #10★ · EN
Nonfoil—Foil—
Card rules
Flying, lifelink
Healing Tears — At the beginning of your end step, return target creature card with mana value X or less from your graveyard to the battlefield, where X is the amount of life you gained this turn.
3/4
Rare · Illustrated by Irina Nordsol
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
The target creature card is chosen as the triggered ability is put on the stack. Gaining life after that point won't let you choose a target with a higher mana value.