https://islamqa.info/en/82152?_e_pi_=7,PAGE_ID10,3789191241
Praise be to Allaah.
Firstly:
The report that ‘Umar ibn al-Khattaab ordered that Taraweeh prayer should be twenty rak’ahs came from four of the Taabi’een. These are their reports:
1 – It was narrated that Saa’ib ibn Yazeed said: ‘Umar ibn al-Khattaab (may Allaah be pleased with him) gathered the people together in Ramadaan to be led by Ubayy ibn Ka’b and Tameem al-Daari in praying twenty-one rak’ahs, and they used to recite hundreds of verses, and they dispersed before dawn broke.
A number of narrators narrated it from al-Saa’ib, some of whom mentioned twenty rak’ahs or twenty-one or twenty-three. They were:
Muhammad ibn Yoosuf, the son of the sister of al-Saa’ib, from al-Saa’ib, as was narrated by ‘Abd al-Razzaaq inal-Musannaf(4/260) from the report of Dawood ibn Qays and others.
Yazeed ibn Khusayfah. This was narrated by Ibn al-Majd inal-Musnad(1/413), and via him by al-Bayhaqi inal-Sunan(2/496).
Al-Haarith ibn ‘Abd al-Rahmaan ibn Abi Dhubaab. This was narrated by ‘Abd al-Razzaaq inal-Musannaf(4/261).
These reports are saheeh reports narrated by trustworthy narrators from al-Saa’ib ibn Yazeed. They mention twenty rak’ahs at the time of ‘Umar ibn al-Khattaab (may Allaah be pleased with him). The extra amount mentioned – twenty-one or twenty-three, refers to Taraweeh plus Witr.
2 – It was narrated that Yazeed ibn Rumaan said: At the time of ‘Umar ibn al-Khattaab the people used to pray twenty-three rak’ahs of qiyaam in Ramadaan.
This was narrated from him by Maalik inal-Muwatta’(1/115). Al-Nawawi said inal-Majmoo’(4/33: It is mursal, because Yazeed ibn Rumaan did not live at the same time as ‘Umar. End quote.
3 – It was narrated from Yahya ibn Sa’eed al-Qattaan that ‘Umar ibn al-Khattaab (may Allaah be pleased with him) ordered a man to lead them in twenty rak’ahs of prayer. This was narrated by Ibn Abi Shaybah inal-Musannaaf(2/163) from Wakee’ from Maalik. But Yahya ibn Sa’eed did not live at the same time as ‘Umar.
4 – It was narrated that ‘Abd al-‘Azeez ibn Rafee’ said: Ubayy ibn Ka’b used to lead the people in praying twenty rak’ahs during Ramadaan in Madeenah, and he would pray Witr with three rak’ahs.
This was narrated by Ibn Abi Shaybah inal-Musannaf(2/163).
From all these reports it is clear that twenty rak’ahs was the way that Taraweeh was usually done at the time of ‘Umar ibn al-Khattaab (may Allaah be pleased with him). A matter such as Taraweeh prayer is something that is well known among all people, and is transmitted from one generation to another. The report of Yazeed ibn Rumaan and Yahya al-Qattaan is to be taken into account even if they did not live at the same time as ‘Umar, because undoubtedly they learned it from a number of people who had been alive at the time of ‘Umar, and this is something that does not need and isnaad, rather all the people of Madeenah are its isnaad.
Imam al-Tirmidhi (may Allaah have mercy on him) said in hisSunan (3/169):
Most of the scholars are of the view that what is narrated from ‘Umar, ‘Ali and other companions of the Prophet (peace and blessings of Allaah be upon him) is twenty rak’ahs. This is the view of al-Thawri, Ibn al-Mubaarak and al-Shaafa’i.
Al-Shaafa’i said: This is what I learned in our land, in Makkah they pray twenty rak’ahs.
Ibn ‘Abd al-Barr said in al-Istidhkaar (2/69):
Twenty rak’ahs was narrated from ‘Ali, Shateer ibn Shakl, Ibn Abi Mulaykah, al-Haarith al-Hamadaani and Abu’l-Bakhtari. It is the view of the majority of scholars and it is the view of the Kufis, the Shaafa’is and most of the fuqaha’. It was narrated in saheeh reports from Ubayy ibn Ka’b, and there was no difference of opinion among the Sahaabah.
‘Ata’ said: I grew up at a time when the people prayed twenty-three rak’ahs including Witr.
See that inMusannaf Ibn Abi Shaybah(2/163).
Ibn Taymiyah (may Allaah have mercy on him) said inMajmoo’ al-Fataawa(23/112):
It is proven that Ubayy ibn Ka’b used to lead the people in praying twenty rak’ahs in qiyaam in Ramadaan, and he used to pray Witr with three rak’ahs. Many scholars think that this is the Sunnah, because he established that among the Muhaajireen and Ansaar and no one objected to that. Others regarded it as mustahabb to pray thirty-nine rak’ahs, based on the fact that this was the practice of the people of Madeenah in the past. End quote.