Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
As for your question on offering two rakahs during Friday sermon, the late Sheikh Sayyed Sabiq states in his well-known book, Fiqh As-Sunnah:
It is a Sunnah to offer supererogatory prayers before Friday prayer until the Imam arrives. After the Imam’s arrival, one should no longer offer any prayer, save for two rakahs of greeting the mosque (tahiyyatul-masjid).
This may be performed quickly while the khutbah (Friday sermon) is delivered unless one comes at the end of the khutbah and does not have enough time (i.e., before the actual prayer begins) to perform tahiyyatul-masjid.
The aforementioned view is adopted by Imam ash-Shafi`i, Imam Ahmad, Ishaq and many other scholars. They quote the following hadith in support of their view:
Jabir (may Allah be pleased with him) reported that a man entered the mosque while the Prophet (peace and blessings be upon him) was delivering a Friday sermon. The Prophet asked him, “Have you offered the prayer of greeting the mosque?” The man replied, “No!” He told him, “Pray two rakahs.” (An-Nasa’i)
In another narration, it is stated, “If one of you entered the mosque on the day of Friday while the Imam is delivering the sermon, he should pray two rakahs and offer them quickly.” (Ahmad, Muslim and Abu Dawud)
In another narration, it is stated, “If one of you comes to the mosque on the day of Friday and the Imam has already arrived, he should offer two rak`ahs.” (Al-Bukhari and Muslim)
Malik, al-Layth, Abu Hanifah, ath-Thawri and many other successors are of the view that any person who enters the mosque, while the Imam is delivering the Friday sermon, is not to perform these two rakahs of greeting the mosque. They say that such a person is ordered to listen to the Imam and, thus, he is to sit down.
Based on the above, it becomes crystal clear that there is a difference among scholars concerning this issue. In the light of the aforementioned views, we conclude that performing two rakahs in the midst of Friday sermon is optional; one can offer them or sit down and listen to the sermon upon entering the mosque.
Allah Almighty knows best.