Thank you for contacting About Islam with your question.
Dr. Shabir Ally addresses this question in the video below:
Aisha Khaja: So, Dr. Shabir, is it true at some point in the prayer that Muslims should say peace be upon you, oh Prophet?
Dr. Shabir Ally: The answer that is yes. And the question stems from the concern that we worship only God.
And in our prayer, how could we be addressing the Prophet Muhammad (peace be upon him)? Now when we do that, we should have in mind that the, our belief is that the souls of the prophets do remain alive.
So, that even though their body obviously have suffered deaths, as our bodies do. But that means they have consciousness. But their consciousness is more local so that the angels will deliver our message to the Prophet Muhammad (peace be upon him).
Now, when we speak to other people we say, peace be upon you. So, in the prayer, we are saying peace be upon you, oh Prophet.
And we believe that even though he cannot hear us because he’s not here where we are, the angels will take that greeting to him and announce to him that such and such a person is sending a greeting to you. And then he responds as well.
But it’s just a greeting. It’s not a prayer.
But to avoid any of this discussion, a variation of the prayer is instead of saying “assalamu alayka ayoo nabiyee”, which means peace be upon you, oh Prophet: we can say “assalamo allan nabiyee”, peace be upon the Prophet, which is in absentia.
It’s peace be upon him as we say now in our conversation- peace be upon him, rather than peace be upon you. Some of the Companions of the Prophet (peace be upon him) relate that, during the Prophet’s lifetime, they used to say peace be upon you, oh Prophet.
But after he died, they began to say peace be upon the Prophet, now referring to him in the third person. So, this alleviates any question about the worship itself.
I hope this helps answer your question. Please keep in touch.
Please continue feeding your curiosity, and find more info in the following links: