If Rayami, First of The Fallen is in the command zone, does his ability still activate?
Creatures will only be exiled by that ability if Rayami is on the battlefield.

In general, abilities on permanent cards only function while the card is on the battlefield. There are some exceptions, but they mostly boil down to "Does the ability only make sense in another zone, or specifically say that it works in another zone?" The details are in rule 113.6.