For someone who is completely unable to prostrate, they can pray while sitting. If they are unable to sit, they can pray while lying down. In this case, they should perform the prayer in the best way possible according to their ability. They can also perform the bowing (ruku) while sitting or lying down, as long as they can do so safely.
It is important to remember that Allah does not burden a soul beyond its capacity. Therefore, one should pray in a manner that is feasible for them, and they should not feel pressured to perform actions that could harm their health.
For further details, you can refer to the following sources: Sistani's Book on Prayer