A creature 'dies' whenever it is put into a graveyard from the battlefield (CR 700.4). This is true regardless of why it went to the graveyard — whether from lethal damage, a destroy effect, sacrifice, or the legend rule.
The legend rule (CR 704.5j) is a state-based action that causes a player to choose one of their legendary permanents with the same name to keep, putting the rest into the graveyard. When a legendary creature is placed into the graveyard this way, it has moved from the battlefield to the graveyard, satisfying the definition of 'dies.'
Triggered abilities that use the phrase 'when this creature dies' are governed by CR 603.6a, which checks whether the creature is now in the appropriate zone (the graveyard) and whether it was on the battlefield just before it moved. A creature sacrificed to the legend rule meets both criteria, so the trigger fires normally.
Example: You control a Geist of Saint Traft that has a 'when this creature dies, create a Spirit token' ability. You then play a second Geist of Saint Traft. The legend rule forces you to put one into the graveyard. The one you put in the graveyard triggers its 'when this creature dies' ability, and you create the Spirit token.
Note that if the creature has a replacement effect saying 'if it would be put into a graveyard, exile it instead,' that replacement would apply even to the legend rule, and in that case the creature would not 'die' and the trigger would not fire (CR 700.4, 614.1a).
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.