All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The verse you asked about is the verse in which Allah Says (what means): {There shall be no compulsion in [acceptance of] the religion. The right course has become clear from the wrong. So whoever disbelieves in Taghut and believes in Allah has grasped the most trustworthy handhold with no break in it. And Allah is Hearing and Knowing.} [Quran 2:256] This verse was revealed in Madeenah.
Tafseer (interpretation of the Quran) Al-Khazin reads:
{There shall be no compulsion in [acceptance of] the religion}, the reason for the revelation of this verse according to what was narrated from Ibn ‘Abbaas, is that he said: ‘Any woman from the Ansar whose born children always died, used to make a vow that if one of her children lived, she would make him a Jew, so if a child lived for her, she would make him a Jew. When Islam was revealed, there were some of these children with the Jews, so when Banu an-Nadheer (a tribe of the Jews) were expelled from Madeenah, there were a number of Ansar’s children among them, so the Ansar wanted to take their children back and said, “They are our sons and our brothers.” So, the verse {There shall be no compulsion in [acceptance of] the religion}, was revealed.
The Prophet said: “Your children were given the choice; if they choose you, then they are among you, and if they choose them [the Jews], then evacuate them along with them.”
It was also said: “A man from the Ansar, from Banu Saalem ibn ‘Awf, whose name was Abu al-Hussayn, had two sons who became Christians before Muhammad was commissioned as a Prophet, then they came to Medeena with a group of Christians carrying oil. So, their father took them and said: ‘I will not leave you until you embrace Islam.’ So, they complained to the Prophet and the Ansari man said: “Oh, Messenger of Allah, will my children enter Hellfire while I will be looking at them?” Then Allah revealed {There shall be no compulsion in [acceptance of] the religion}. So, the Ansari man let them go.
Allah Knows best.