Here is the verse:

Quran 2: 256: لَآ إِكْرَاهَ فِى ٱلدِّينِ (There is no compulsion in religion).

And here is the context of this verse (as given by Ibn Kathir and Ibn Jarir).

Sunan Abi Dawud, 2682:

When the children of a woman (in pre-Islamic days) did not survive, she took a vow on herself that if her child survives, she would convert it a Jew. When Banu an-Nadir were expelled (from Arabia), there were some children of the Ansar (Helpers) among them. They said: We shall not leave our children. So Allah the Exalted revealed; "Let there be no compulsion in religion. Truth stands out clear from error."

So basically the verse came for the non-muslim Jews, telling them to not force their religion (i.e. Judaism) on the sons of Ansar (who were Muslims). 

As far as Muslims are concerned, then Muhammad gave only this order to kill any Muslim who changes his religion and leaves Islam. 


Muhammad himself compelled polytheists to accept Islam, otherwise they should be killed

What more proof do we need about this compulsion, when Muhammad himself ordered to kill all polytheists who didn't accept Islam? He didn't even accept Jizya from polytheists (Jizya was allowed only for the people of the Book (i.e. Christians/Jews/Magians). 

Imam Wahidi recorded the following tradition under the commentary of verse 5:105:

Ibn 'Abbas said: “The Messenger of Allah sent a letter to the people of Hajar, whose chief was Mundhir ibn Sawa, inviting them to Islam, or to pay the Jizyah if they chose not to embrace Islam. When Mundhir ibn Sawa received the letter, he showed it to the Arabs, Jews, Christians, Sabeans and Magians who were around him. They all agreed to pay the Jizyah and disliked embracing Islam. The Messenger of Allah, Allah bless him and give him peace, wrote back to him, saying: 'As for the Arabs, do not accept from them except Islam otherwise they will have nothing but the sword. As for the people of the Book and the Magians, accept the Jizyah from them. When this letter was read to them, the Arabs embraced Islam while the people of the Book and the Magians agreed to pay the Jizyah.

Please read our detailed article: The Verse of Killing All Polytheists (Quran 9:5) Remains Valid Today in the case if Shafii, Hanbali, or Salafists Establish an Islamic State

The largest Islamic Fatwa website “Islam Question Answer” (which is run by Saudi Mufties) writes:

https://islamqa.info/en/34770

Question: 

Some friends say that whoever does not enter Islam, that is his choice and he should not be forced to become Muslim, quoting as evidence the verses in which Allaah says (interpretation of the meaning): 
“And had your Lord willed, those on earth would have believed, all of them together. So, will you (O Muhammad) then compel mankind, until they become believers” 
[Yoonus 10:99] 
“There is no compulsion in religion” 
[al-Baqarah 2:256] 
What is your opinion concerning that?.

Answer:

The scholars explained that these two verses, and other similar verses, have to do with those from whom the jizyah may be taken (i.e. Ahle Kitaab), such as Jews, Christians and Magians (Zoroastrians). They are not to be forced, rather they are to be given the choice between becoming Muslim or paying the jizyah. 

Other scholars said that this applied in the beginning, but was subsequently abrogated by Allaah’s command to fight and wage jihad. So whoever refuses to enter Islam should be fought when the Muslims are able to fight, until they either enter Islam or pay the jizyah if they are among the people who may pay jizyah (i.e. Ahle Kitaab). 
The kuffaar should be compelled to enter Islam if they are not people from whom the jizyah may be taken (i.e. Ahle Kitaab), because that will lead to their happiness and salvation in this world and in the Hereafter ...
Some of the scholars are of the view that others may also be given the choice between Islam and jizyah, but the most correct view is that no others should be given this choice, rather these three groups are the only ones who may be given the choice, because the Prophet (peace and blessings of Allaah be upon him) fought the kuffaar in the Arabian Peninsula and he only accepted their becoming Muslim. And Allaah says (interpretation of the meaning): 

“Then when the Sacred Months (the 1st, 7th, 11th, and 12th months of the Islamic calendar) have passed, then kill the Mushrikoon (see V.2:105) wherever you find them, and capture them and besiege them, and lie in wait for them in each and every ambush. But if they repent [by rejecting Shirk (polytheism) and accept Islamic Monotheism] and perform As-Salaah (Iqaamat-as-Salaah), and give Zakaah, then leave their way free. Verily, Allaah is Oft-Forgiving, Most Merciful”

[al-Tawbah 9:5]  

Ibn Kathir writes in the commentary of verse 2:256 (link):

وقد ذهب طائفة كثيرة من العلماء، أن هذه محمولة على أهل الكتاب، ومن دخل في دينهم قبل النسخ والتبديل إذا بذلوا الجزية، وقال آخرون بل هي منسوخة بآية القتال، وإنه يجب أن يدعى جميع الأمم إلى الدخول في الدين الحنيف، دين الإسلام، فإن أبى أحد منهم الدخول فيه، ولم ينقد له، أو يبذل الجزية، قوتل حتى يقتل، وهذامعنى الإكراه، قال الله تعالى { سَتُدْعَوْنَ إِلَىٰ قَوْمٍ أُوْلِى بَأْسٍ شَدِيدٍ تُقَـٰتِلُونَهُمْ أَوْ يُسْلِمُونَ } [الفتح: 16] وقال تعالى: { يَٰأَيُّهَا ٱلنَّبِىُّ جَـٰهِدِ ٱلْكُفَّـٰرَ وَٱلْمُنَـٰفِقِينَ وَٱغْلُظْ عَلَيْهِمْ } [التوبة: 73] وقال تعالى: { يَٰأَيُّهَا ٱلَّذِينَ ءَامَنُواْ قَاتِلُواْ ٱلَّذِينَ يَلُونَكُمْ مِّنَ ٱلْكُفَّارِ وَلِيَجِدُواْ فِيكُمْ غِلْظَةً وَٱعْلَمُوۤاْ أَنَّ ٱللَّهَ مَعَ ٱلْمُتَّقِينَ }[التوبة: 123] وفي الصحيح: " عجب ربك من قوم يقادون إلى الجنة في السلاسل " يعني: الأسارى الذين يقدم بهم بلاد الإسلام في الوثائق والأغلال والقيود والأكبال، ثم بعد ذلك يسلمون، وتصلح أعمالهم وسرائرهم، فيكونون من أهل الجنة.

Large number of Scholars are of opinion that this verse (2:256) "There is no compulsion in religion" was meant only for the People of Book (i.e. only Jews and Christians will not be compelled to accept Islam), but they have to pay Jizyya.
While, other Scholars say that this verse of "No Compulsion" had been abrogated (even for the People of Book) through the verse of sword (verse 9:5)"...Therefore, all people of the world should be called to Islam. If anyone of them refuses to do so, or refuses to pay the Jizya they should be fought till they are killed. This is the meaning of compulsion.
Allah says in verse 48:16;"O Prophet, fight with them till the time they accept Islam."...
In the Sahih, the Prophet said: "Allah wonders at those people who will enter Paradise in chains", meaning prisoners brought in chains to the Islamic state, then they embrace Islam sincerely and become righteous, and are entered among the people of Paradise.

A few more historical facts are as under:

(1) The Verse of “No Compulsion in religion” was revealed in the initial period of Medina when Muslims were weak. 

(2) Verse of Sword (i.e. Killing all the Mushrikeen) was revealed at the end of the 9th Hijri, when Muslims got full power and control and no power was left in Arabia to stop Muslims from using power.

(3) Thus, Muhammad killed all the Polytheists (Mushrikeen) in Arabia. This practice also continued during the era of Companions (Sahaba). 

(4) Then came Abu Hanifa, who was the first one who said it was only obligatory upon Prophet Muhammad to kill all the Mushrikeen, but now Muslims could also take Jizya from Polytheists and let them live. 

(5) But Imam Ahmed bin Hanbal and Imam Shafii and Imam Ibn Hazm contradicted this new fatwa of Abu Hanifa, while there was an Ijma of Companions (Sahaba) that Polytheists should be kept killing even after the death of Prophet Muhammad. 

Imam Ibn Hajar al-Asqallani writes in his book “Fath-ul-Bari” (link):

وروى عبد بن حميد في تفسير سورة البروج بإسناد صحيح عن ابن أبزى " لما هزم المسلمون أهل فارس قال عمر : اجتمعوا . فقال : إن المجوس ليسوا أهل كتاب فنضع عليهم ، ولا من عبدة الأوثان فنجري عليهم أحكامهم فقال علي : بل هم أهل كتاب "’
Translation:
According to an "authentic tradition" when Muslims defeated the Persians, then Umar Ibn Khattab (the 2nd Caliph) collected the Companions (Sahaba) and asked them that Zoroastrians are neither from people of book (Ahl-e-Kitaab) that we take Jizya from them, nor are they from Polytheists that we kill them.
Upon that Ali Ibn Abi Talib (the 4th Caliph) witnessed that Zoroastrians are among the people of book.

And Saudi Mufti Albani graded this hadith of Sunan Abu Dawud as “authentic” (link):

لم يكن عمر يأخذ الجزية من المجوس حتى شهد عبد الرحمن بن عوف أن رسول الله صلى الله عليه وسلم أخذها من مجوس هجر .
Translation:
Umar Ibn Khattab didn't want to take Jizya money from Zoroastrians (but wanted to kill them as Polytheists), but companion Abdul Rehman bin Auf told him that Prophet Muhammad took Jizya money from Zoroastrians too.

Imam Ibn Hajar al-Asqallani also recorded the following “authentic” tradition (link):

وروى أبو عبيد بإسناد صحيح عن حذيفة " لولا أني رأيت أصحابي أخذوا الجزية من المجوس ما أخذتها "
Translation:
If my companions had not taken Jizya money from Zoroastrians, then I would have not taken it from them (but killed them as polytheists).

(6) If today any Islamic Caliphate is established from followers of Imam Ahmed bin Hanbal (i.e. Salafies) or Imam Shafii, then once against this Islamic Caliphate is going to compel the Polytheists/Atheists to accept Islam or otherwise they will slaughter them.

So this much to “No Compulsion”.

Actually, compulsion is everywhere when a person is denied his basic human right and threatened to be killed if he leaves Islam.

And compulsion is there when non-Muslims are not allowed to do Tableegh of their views and they will be killed if they do so.

For more, please see:

http://web.archive.org/web/20160306112927/http://www.answering-islam.de/Silas/swordverse.htm