Starfleet had only one capital offense: General Order 7. Or General Order 4. I mix them up.
Federation member planets were free to use the death penalty, though. And pretty gruesome methods of execution at that. Argelius: death by slow torture, for example.
Deneb V made punishable by death. Spock rattles off a list in “I, Mudd”.
Intriguingly, Kirk got M-5 to admit that the penalty for murder is death, suggesting that capital punishment is Federation law. Of course, the Feds aren’t exactly soft when it comes to non-lethal punishments. Twenty years in a rehabilitation colony for transporting tribbles seems a bit much.