The number of rakats will depend on which school of fiqh you follow.
A reader not familiar with fiqh may be confused by other schools of fiqh. Which is right or wrong? Which should I follow?
This is not a matter of correctness but a matter of preference. A follower of one fiqh should not criticize or look down on the follower of another.
According to the Hanafi fiqh the number of rakats for each prayer are given below:
Number of Sunnah Rakat Before Jummah
The Sunnah of Prophet Muhammad (ﷺ) before Jummah was to pray 4 sunnah ghair muakkadah. Next would be 2 fardh (prayed in congregation), followed by 4 Sunnah muakkadah, 2 Sunnah muakkadah, and then 2 nafl.
In total there would be 14 rakats for Friday prayer.
For those unfamiliar, ghair mu’akkadah means salat which were sometimes performed by the Prophet, may peace be upon him, but sometimes it was abandoned.
Sunnah mu’akkadah is voluntary act of worship (praying Eid prayer or 2 Sunnah rakat of Maghrib). These the Prophet prayed regularly and made a point to never abandon. So although it is not mandated, a person who intentionally skips them is considered blameworthy.
Hadith on Jummah Rakat
Here’s the hadith which mention the number of rakats the Prophet used to pray for Jummah salat.
1. Abu Hurairah narrated that: Allah’s Messenger said: “Whoever among you is to pray after the Friday prayer, then let him pray four.” Grade: Sahih (Darussalam) Reference: At-Tirmidhi 523
2. Narrated Abd Allah b. Shaqiq: I asked A’ishah about the voluntary prayers offered by the Messenger of Allah (ﷺ). She replied: Before the noon prayer he would pray four rak’ahs in my house, then go out and lead the people in prayer, then return to my house and pray two rak’ahs. Grade: Sahih (Al-Albani) Reference: Sunan Abi Dawud 1251
3. Abdullah b. ‘Umar, while describing the Nafl prayer of the Messenger of Allah (ﷺ), said: He did not observe (Nafl) prayer after Jumu’a till he went back and observed two rak’ahs in his house. Yahya said: I guess that I uttered these words (before Imam Malik) that he of course observed (them). Reference: Sahih Muslim 882 b
From the combination of these hadiths we can see where the four rak’ah before Jummah prayer comes from, the 4+2 Sunnah mu’akkadah after prayer and then the 2 Nafl.
If any of us had made an unintentional mistake, may Allah forgive us.