The second ability checks how many Islands are on the battlefield (regardless of who controls them) only as attackers are declared. Once Harbor Serpent is declared as an attacker, it will continue to attack even if the number of Islands on the battlefield falls below five.

Artwork
Loading artwork…
Harbor Serpent
Magic 2013 · #53 · EN
Nonfoil—Foil—
Card rules
Islandwalk (This creature can't be blocked as long as defending player controls an Island.)
This creature can't attack unless there are five or more Islands on the battlefield.
5/5
Like most giant monsters villagers worship as gods, it proves a fickle master.
Common · Illustrated by Daarken
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pauper Legal
Pauper Commander Legal
Penny Legal
PreDH Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pioneer 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
Harbor Serpent's abilities care about lands with the land type Island, not necessarily lands named Island.