The 10th paara, 9th surah and 5th taubah ayat of Quran states this (mentioned in the picture below) which literally translates to “Then when the Sacred Months (the Ist, 7th, 11th, and 12th months of the Islamic calendar) have passed, then kill the Mushrikun (see V. 2:105) wherever you find them, and capture them and besiege them, and prepare for them each and every ambush. But if they repent and perform As-Salat (Iqamat-as-Salat), and give Zakat, then leave their way free. Verily, Allah is Oft-Forgiving, Most Merciful.” This is translated by Muhsin Khan. You can find more translation to this on this link:
Is this what the Quran is teaching? If not then please enlighten me (all) with a justification.