It triggers when the spell is cast, which means it becomes a creature before that spell resolves.

Artwork
Loading artwork…
Veiled Serpent
Dominaria Remastered · #72 · EN
Nonfoil—Foil—
Card rules
When an opponent casts a spell, if this permanent is an enchantment, it becomes a 4/4 Serpent creature with "This creature can't attack unless defending player controls an Island."
Cycling 2 (2, Discard this card: Draw a card.)
Common · Illustrated by Bob Eggleton
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Penny Legal
PreDH Legal
Premodern Legal
Tlr 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
Pioneer Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
It changes into a creature even if the spell is countered.
When it turns into a creature, it is no longer an enchantment.
A noncreature permanent that turns into a creature can attack, and its
abilities can be activated, only if its controller has continuously controlled that permanent since the beginning of their most recent turn. It doesn't matter how long the permanent has been a creature.