Is it permissible to do the regular Sunnah prayers and supererogatory (nafil) prayers in the car when one is not travelling?
Question

Is it valid for me to pray Duha in the car because I stay in the car for half an hour before I reach school? Will there be the same reward for it as if I prayed it at school?
Praise be to Allah.There are three scenarions here:
1.. Offering a supererogatory prayer sitting in the car and not facing towards the qiblah, when travelling.
2.. Offering a supererogatory prayer sitting in a parked car and facing towards the qiblah, when not travelling.
3.. Offering a supererogatory prayer sitting in a moving car and not facing towards the qiblah, when not travelling.
Regarding the first and second scenarios, there is scholarly consensus that they are permissible.
Regarding the third scenario, there is a difference of scholarly opinion concerning it.
This may be explained, briefly, as follows:
With regard to the first issue:
It is proven in the sahih Sunnah that the Prophet (blessings and peace of Allah be upon him) used to offer supererogatory prayers on his mount when travelling, no matter what direction it faced. Thus the condition of facing towards the qiblah is waived, as is the requirement to stand during the prayer, but that is on condition that the prayer is supererogatory (nafil) and it is done when travelling, as noted above.
Based on that, if someone is travelling in a car, he may pray Duha – and other supererogatory prayers – no matter what direction the car is facing, and he should lean forward for bowing and prostration, making his leaning for prostration deeper than his leaning for bowing.
It was narrated from Jabir ibn ‘Abdillah (may Allah be pleased with him) that the Prophet (blessings and peace of Allah be upon him) would offer voluntary prayers whilst riding, not facing in the direction of the qiblah. Narrated by al-Bukhari (1 043) and Muslim (540).
It was narrated that Ibn ‘Umar said: The Prophet (blessings and peace of Allah be upon him) used to pray whilst travelling on his mount, no matter which direction it was facing, leaning forward [to bow and prostrate], offering the night prayers, except the obligatory prayers, and he prayed Witr on his camel. Narrated by al-Bukhari (955) and Muslim (700).
This is a matter concerning which there is scholarly consensus.
In al-Mawsu‘ah al-Fiqhiyyah (27/228 ), it says: The jurists are unanimously agreed that it is permissible for the traveller to offer supererogatory prayers on his mount, no matter what direction it is facing. End quote.
With regard to the second issue:
There is also no difference of opinion among the scholars regarding the permissibility of offering supererogatory prayers sitting and facing towards the qiblah when not travelling, even when one is able to stand, and that in this case the worshipper will have half the reward of one who prays standing.
Ibn Qudamah (may Allah have mercy on him) said:
We do not know of any difference of opinion regarding the permissibility of offering voluntary prayers sitting, although it is better to stand. The Prophet (blessings and peace of Allah be upon him) said: “Whoever prays standing, that is better, and whoever prays sitting, he will have half the reward of the one who prays standing.” Agreed upon. It was narrated by al-Bukhari (1064) only. According to the version narrated by Muslim (735), “A man’s prayer offered sitting is half a prayer.”"(Al-Mughni  1/811).
Based on that, if someone prays Duha – or any other regular Sunnah or supererogatory prayer – in a parked car when not travelling, and the car is facing towards the qiblah – or he is able to make himself face towards the qiblah – there is nothing wrong with him praying in that case, according to scholarly consensus, and it makes no difference whether he prays sitting – in that case – in a car or in a house or mosque. He may lean forward for bowing, as he does in his prayer when sitting in the places we have mentioned. The ruling on praying in a parked car is the same as the ruling when praying on the ground, and the condition of facing towards the qiblah is not waived.
In that case, the worshipper will have half the reward of the prayer of one who prays standing, as noted above in the sahih hadith.
With regard to the third issue:
Is it permissible to pray sitting in a moving car that is not facing towards the qiblah, when not travelling, as is the case when travelling, or is praying in that way not valid except when travelling? There are two scholarly views:
The first view is that it is not permissible, and this is the view of the majority.
The second view is that it is permissible. This is the view of Abu Yusuf, Muhammad the companion of Abu Hanifah, and Abu Sa‘id al-Istakhri among the Shafa‘is. It was narrated from Imam Ahmad, and it is the view of at-Tabari, al-Awza‘i, and Ibn Hazm.
Among contemporary scholars, it is the view of Shaykh ‘Abdullah ibn ‘Aqil and Shaykh ‘Abdullah ibn Qa‘ud. Shaykh ‘Abdullah ibn Jibrin and Shaykh ‘Abd al-Karim al-Khudayr said that it is permissible when the worshipper fears that the time to offer supererogatory or regular Sunnah prayer is about to end.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
With regard to praying on one’s mount, it is proven in as-Sahih – and, in fact, there are many reports from the Prophet (blessings and peace of Allah be upon him) – that he used to pray on his mount when travelling, no matter what direction it was facing in, and he would pray Witr on his mount, but he did not offer any obligatory prayers on it.
But is that justified when not travelling? There are two views in the madhhab of Ahmad and others…"(Majmu‘ al-Fatawa 24/37, 38).
See: Sharh Muslim by an-Nawawi (5/211); al-Majmu‘ by an-Nawawi (3/212); al-Muhalla by Ibn Hazm (3/56); Nayl al-Awtar by ash-Shawkani (2/149).
See also the essay by Shaykh ‘Abdullah ibn ‘Aqil (may Allah preserve him) on this specific topic, entitled Tuhfat al-Qafilah fi Hukm as-Salah ‘ala ar-Rahilah.
According to those scholars, it is permissible for the one who is riding in a moving car on the road to offer Duha – and other regular Sunnah and supererogatory prayers – sitting, but it is not preferred for the driver to do that; the worshipper should lean forward for bowing and prostration, and his leaning forward for prostration should be deeper than his leaning forward for bowing.
What is most likely to be correct regarding this matter is the view of the majority, which is that offering supererogatory prayers sitting and not facing towards the qiblah is only (permissible) for one who is riding on a moving mount [or in a moving vehicle], and when travelling, not when not travelling. This is what is proven from the Prophet (blessings and peace of Allah be upon him), and it is what the contemporary shaykhs ‘Abd al-‘Aziz ibn Baz and al-‘Uthaymin (may Allah have mercy on them both), and many others, thought was most likely to be correct.
See also the answer to question no. 21869 .
Note:
If someone offers a supererogatory (nafil) prayer sitting when he is able to stand, then he should prostrate properly, on the ground, according to the more correct scholarly view. Standing is waived in his case, and bowing is also waived for him, because it is connected to standing.
Ibn Rushd the grandfather – Muhammad ibn Ahmad – said: His saying that the one who sits should not merely lean forward for prostration unless he has a reason for doing, refers to the obligatory prayer. This is the sound view concerning which there is no difference of opinion, because prostrating is obligatory, like standing, so it is not waived unless the worshipper is unable to do it.
Rather he said that he may lean forward [for bowing and prostration] in a supererogatory prayer even if he does not have a reason for doing that, because it was narrated that the Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever prays standing, that is better; whoever prays sitting will have half the reward of one who prays standing; and one who prays lying down will have half the reward of one who prays sitting.” It is known that whoever prays lying down should tilt his head for bowing and prostration. So if it is permissible not to sit and prostrate even when one is able to do it, then it is permissible not to prostrate but still sit.
As for the view of ‘Isa, that he should not lean forward [for bowing and prostrating] in a supererogatory prayer when he has no excuse or reason to do that, based on his not accepting the hadith – like the view of Malik in al-Mudawwanah, that no one should pray lying down except one who is sick – therefore it is not permissible to refrain from sitting and prostrating unless there is a reason.
It may be that it is not permissible to lean forward for prostration when you are able to prostrate, except in the case of one who prays lying down, because the Messenger of Allah (blessings and peace of Allah be upon him) said: “The one who prays sitting will have half the reward of the one who prays standing.” All the scholars understood this hadith as referring to the one who prays sitting and prostrates, because it is not known that the Messenger of Allah (blessings and peace of Allah be upon him), or any of the early generations of the ummah, omitted prostrating properly in a supererogatory prayer when they were able to do it, although he omitted standing in the prayer when he was able to do it."(Al-Bayan wa’t-Tahsil  1/515-516).
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) was asked:
My grandmother is elderly, and standing in prayer is tiring for her, so she offers supererogatory prayers sitting on a chair. As for the obligatory prayers, she prays them standing, and she bows and prostrates properly. My question is: Is she sinning by sitting on a chair? If she is not sinning, is it better for her to pray on the ground or on the chair? Please note that the chair is more comfortable for her.
He replied:
With regard to the obligatory prayer, the matter is clear, because she is doing it as it should be done.
With regard to the supererogatory prayer, if she wants to pray sitting, then she may sit cross-legged on the ground instead of standing and when bowing, then get up after bowing and prostrate on the ground, and sit muftarishan [sitting with the right foot held upright on the toes, whilst sitting on the left foot] between the two prostrations, as usual. Then when she has done the second prostration, she should sit cross-legged, because sitting cross-legged is instead of standing. This is undoubtedly better than praying on the chair, because when preying on the chair, she cannot prostrate on the ground, and thus she misses out on prostration; but if she is able to prostrate, it is not permissible for her to lean forward instead.
Based on that, we say: if your grandmother wants to offer supererogatory prayers, she should pray on the ground and do what we described above, sitting cross-legged instead of standing before bowing, when bowing and when rising from bowing, and she should sit muftarishan between the two prostrations and in the two tashahhuds, and prostrate on the ground. End quote.
And Allah knows best.