The legend rule (CR 704.5j) is a state-based action that checks whether two or more legendary permanents with the same name are on the battlefield under the same player's control. It has nothing to do with creatures dying or going to the graveyard.
When a legendary creature dies (moves from the battlefield to the graveyard), it is no longer on the battlefield at all. State-based actions are checked while it is still on the battlefield, not after it has already moved zones. Once it is in the graveyard, it is simply a card in the graveyard — the legend rule no longer applies to it there.
"Dies" triggers (CR 603.6c) look for a creature card that just moved from the battlefield to the graveyard this turn. These triggers are placed on the stack and resolve normally. There is no conflict or interaction with the legend rule, because the legend rule only ever cares about what is currently on the battlefield.
Concrete example: You control Lurrus of the Dream-Den and it dies to a Lightning Bolt. Lurrus's own "whenever a permanent you controlled with mana value 2 or less dies" trigger (if it had one) would go on the stack and resolve in the graveyard. The legend rule never comes up because you never have two copies of Lurrus on the battlefield simultaneously in this scenario.
In short: death triggers fire based on zone-change events (CR 603.6c), the legend rule is a state-based action checking the battlefield (CR 704.5j), and these two mechanics operate in completely separate contexts.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.