You must return all legendary permanent cards to the battlefield, even if the “legend rule” will put some right back into your graveyard. If any abilities triggered from the legendary permanents entering the battlefield, those abilities will be put onto the stack after applying the “legend rule.”

Artwork
Loading artwork…
Primevals' Glorious Rebirth
Dominaria United Commander · #165 · EN
Nonfoil—Foil—
Card rules
(You may cast a legendary sorcery only if you control a legendary creature or planeswalker.)
Return all legendary permanent cards from your graveyard to the battlefield.
Centuries ago, five dragons conquered death to rule the living.
Rare · Illustrated by Yigit Koroglu
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander 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
All of the permanents put onto the battlefield this way enter at the same time. If any have triggered abilities that trigger on something else entering the battlefield, they'll see each other.
You can't cast a legendary sorcery unless you control a legendary creature or a legendary planeswalker. Once you begin to cast a legendary sorcery, losing control of your legendary creatures and planeswalkers won't affect that spell.
Other than the casting restriction, the legendary supertype on a sorcery carries no additional rules. You may cast any number of legendary sorceries in a turn, and your deck may contain any number of legendary cards (but no more than four of any with the same name).