"Indeed, the number of months with Allah is twelve [lunar] months in the Book of Allah."
Al-Hasan said: It means in the Book of Allah from which the books of the prophets are transcribed, and in all the books of Allah. "Among them are four sacred [months]": al-Muharram, Rajab, Dhu al-Qi'dah, and Dhu al-Hijjah.
"That is the upright religion," meaning: He prohibited these four months through the tongues of His prophets. "So do not wrong yourselves during them." Qatadah's interpretation says: Know that injustice during them is a greater sin [and burden] than in other [months].
"And fight the polytheists collectively," meaning: all of them; and this was when He commanded fighting them all.