he (sallallaahu 'alaihi wa sallam) used to stand in prayer for both obligatory and voluntary prayers, carrying out the command of the exalted:
"and stand before allaah devoutly." (baqarah, 2:238).
as for during a journey, he would pray voluntary prayers on his riding beast.
he set the example for his ummah to pray during severe fear on foot or while mounted, as has been mentioned, and that is the purpose of the saying of allaah:
"guard strictly your (habit of) prayers, especially the middle prayer14, and stand before allaah devoutly. if you fear (an enemy) then pray on foot, or while riding. but when you are in security, celebrate allaah's praises in the manner he has taught you, which you did not know before." (baqarah, 2:238-9)
he (sallallaahu 'alaihi wa sallam) prayed sitting during the illness of which he died."15 he also prayed sitting on another occasion before that, when he was injured, and the people behind him prayed standing; so he indicated to them to sit, so they sat (and prayed). when he finished, he said, you were going to do as the persians and the romans do: stand for their kings who sit. so do not do so, for the imaam is there to be followed: when he makes rukoo', make rukoo', when he rises, rise; and when he prays sitting, pray sitting [all of you].16
14 i.e..,the `asr prayer according to the correct saying of the majority of scholars, among them abu haneefah and his two students. there are ahaadeeth about this which ibn katheer has given in his tafseer of the qur'aan.
15 tirmidhi, who declared it saheeh, and ahmad.
16 muslim and bukhaari, and it is given in my book irwaa' al-ghaleel under hadeeth 394.