Reference: binbaz.org.sa
Question: What is the ruling regarding the taraaweeh prayer in Ramadhaan of a man [who is] alone in his house, and how many raka’aat [should be prayed in total]? And may Allaah reward you with good.
Response: Establishing the night prayer (taraaweeh) in the masjid during Ramadhaan is a sunnah. He ﷺ said:
That he prays the night prayer (taraaweeh) in Ramadhaan with his [Muslim] brothers in the masjid is better [for him]. And if he were to pray at home, then there is no harm [in doing so].
And it (the taraaweeh prayer) has no specific limit, however, it is better [to pray a total of] 11 rak’ahs or 13 rak’ahs – this is best. And if he prayed more [than this, let’s say] 20 and then the witr, or 30 and then the witr, or 40 and then the witr – then there is no harm [in doing so], and all Praise is due to Allaah [alone].
However, the best is to do what the Prophet ﷺ did – [and that was] 11 or 13 rak’ahs [in total], and this is the most that has been [authentically] reported about him doing.
And he is to offer [the prayer] in [the form of] 2 rak’ahs [each], followed by a single rak’ah of witr – and this is best – whether he prays during the first part of the night, or the middle part of the night, or the last part of the night, or if he were to split the [taraaweeh] prayer [across the entire night] and prays some during the first part of the night, and some during the middle part of the night and some during the last part of the night – then there is no harm in any of this.
And likewise in the masjid, if they pray the entire [taraaweeh] prayer during the first part of the night, or the last part of the night, or pray some [of it] during the first part of the night and some [of it] during the last part of the night – then alhamdu-lillaah, there is no harm in any of this, [since] the issue is open [and not restricted]. That is because the Messenger ﷺ did not specify anything [in this regard], [as] he said:
…and with the arrival of the final 10 nights [of Ramadhaan], he ﷺ remained awake all night, so the issue is quite open [in this regard].
So if he remains awake the entire night during [each of] the last ten [nights] – from the beginning right through to its end – then that is the best. And if he rests in between, then there is no harm in that. And if he prays the taraaweeh prayer during the first part of the night, or if they agree to pray it during the last part of the night, then there is no harm in any of that, and all Praise is due to Allaah [alone].