Cannot Pray Standing Up
Question

There is a sick person who, if he stands, he cannot sit down, and if he sits, he cannot stand up. How should he pray? Should he sit throughout the entire prayer, or should he stand throughout the prayer?
Praise be to Allah.Importance of doing obligatory and pillars parts of the prayer 
The basic principle with regard to the pillars and obligatory parts of the prayer is that the worshipper must do whatever he can, and whatever he is not able to do is waived in his case.
Based on that, if the worshipper is able to start the prayer standing, then this is what he must do, then bow properly if he is able to. If he is not able to do that, then he may lean forward as much as he is able.
If he is able to prostrate on the ground, then this is what he must do. If he is not able to prostrate on the ground, then he may sit (on the floor or on a chair), then he may lean forward for prostration.
If he is not able to stand up again , then he may complete his prayer sitting , leaning forward for bowing, and prostrating on the ground if he is able to. If he is not able to do that, then he may lean forward for prostration, and make the leaning for prostration lower than the leaning for bowing.
In this way, the worshipper will have complied with the words of Allah, may He be exalted (interpretation of the meaning): “So fear Allah as much as you are able”  [At-Taghabun 64:16], and with the words of the Messenger (blessings and peace of Allah be upon him): “If I command you to do anything, do as much of it as you can.” (Narrated by Al-Bukhari, 7288 and Muslim, 1337)
In Mukhtasar Khalil, which is a Maliki book, it says: If he is able to do everything, but if he prostrates he cannot get up again , then he should complete a Rak`ah, then remain seated.
Al-Khurashi (may Allah have mercy on him) said in his Sharh (1/298): 
“That is, if the worshipper is able to do all the pillars of the prayer, namely standing, reciting Fatihah, bowing, prostrating, rising from the two prostrations and sitting, but if he sits he will not be able to get up and stand, then he should do the first Rak`ah standing, and complete the rest of his prayer sitting. This is the view favoured by Al-Lakhmi, At-Tunisi and Ibn Yunus. It was also said that he should offer all of his prayer standing and leaning forward (for bowing and prostration), except the last Rak`ah, in which he should bow and prostrate normally.” 
Can you pray standing up?
If the worshipper is able to stand and lie down, but he is not able to sit, then he may pray standing, leaning forward for bowing and prostrating, and reciting the Tashahhud whilst standing, then saying the Taslim.
Zakariyya Al-Ansari Ash-Shafa`i (may Allah have mercy on him) said in Asna Al-Matalib (1/146):
“Whoever is able to stand and lie down only, may stand instead of sitting, because standing is like sitting and more, and he should lean forward instead of bowing and prostrating, and recite the Tashahhud whilst standing. He should not lie down.” 
In Hashiyat Al-`Ibadi `Ala Tuhfat Al-Muhtaj (2/23) it says:
“If he is able to stand or to lie down only, i.e., he is not able to sit, then he should stand and that is obligatory, because standing is like sitting and more, and he should lean forward as much as he can whilst standing up for bowing and prostration … and he should recite the Tashahhud and Tasleem whilst standing; he should not lie down.” 
Al-Khurashi Al-Maliki (may Allah have mercy on him) said (1/297):
“The one who is unable to do all the pillars of the prayer, except standing, which he is able to do, should do all of his prayer standing, and lean forward more for his prostration than for his bowing.” 
If he is not able to stand, then he may pray sitting, and lean forward instead of bowing and prostrating. If he is able to prostrate on the ground, then he must do that.
Ibn Qudamah (may Allah have mercy on him) said in Al-Mughni (2/570):
“The scholars unanimously agreed that the one who is not able to stand may pray sitting.” 
In Hashiyat Al-Dusuqi (2/475), it says that “the one who is unable to stand may offer the prayer sitting, doing the bowing and prostration from that position.” 
If there is a sick person who can either stand for the entire prayer or sit for the entire prayer, then he should pray sitting.
This is indicated by the fact that Islamic teaching waives the obligation of standing in some cases, such as in the supererogatory prayers, or when a man who is able to stand prays behind an Imam who is sick and prays sitting; in that case, he should refrain from standing and pray sitting like his Imam.
Shaykh Al-Islam Ibn Taymiyyah (may Allah have mercy on him) said: “Standing is a pillar of the prayer, but it may be waived in any supererogatory prayer, and may be waived in obligatory prayers in some circumstances.” (Sharh Al-`Umdah (4/515)
If there is a conflict between standing and sitting, then doing the prayer sitting is what takes precedence, especially when it is possible, when sitting, to do other pillars of the prayer, such as prostrating, sitting between the two prostrations, and sitting to recite the Tashahhud. 
Therefore, it is more appropriate to pray the entire  whilst standing.
For more details, please see the following answers: 50075 , 180122 , 10352 , and 13406 . 
And Allah knows best.