Praise be to Allah, the Lord of the World; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
The Hadith referred by the questioner is reported in Sahih Bukhari and Muslim. The Prophet (Sallallahu Alaihi wa Sallam) said: "I have been ordered to fight against the people until they testify that there is no one worthy of worship but Allah and that Muhammad is the Messenger of Allah and until they perform the Prayers and pay the Zakah, and if they do so they will have gained protection from me for their lives and property, unless [they do acts that are punishable] in accordance with Islam, and their reckoning will be with Allah Most High. [Bukhari, Muslim]. That means he is ordered to fight them unless they accept Islam and follow its rulings openly.
The general rule in Islam is that one should understand this Hadith or others in the light of other texts of Sharia. Allah Ordered in many verses to fight those who do not believe in Him. Allah Says (interpretation of meaning): {Fight against those who (1) believe not in Allâh, (2) nor in the Last Day, (3) nor forbid that which has been forbidden by Allâh and His Messenger (4) and those who acknowledge not the religion of truth (i.e. Islâm) among the people of the Scripture (Jews and Christians), until they pay the Jizyah with willing submission, and feel themselves subdued.}[9:29].
In the above verse Allah made clear that the purpose of fighting is to take Jizyah -with feeling themselves subdued- from them, (Jizyah is the tax levied from the people of scriptures who are under the protection of a Muslim government). This verse conforms with the Hadith reported by Imam Muslim who said: "When the messenger (Sallallahu Alaihi wa Sallam) of Allah appointed anyone as leader of an army or detachment he would especially exhort him and say: "When you meet enemies who are polytheists, invite them to three courses of action. If they respond to any one of these, you also accept it and restrain yourself from doing them any harm. Invite them to (accept) Islam; if they respond to you, accept it from them and desist from fighting against them. If they refuse to accept Islam, demand from them the Jizyah. If they agree to pay, accept it from them and hold your hand. If they refuse to pay the tax, seek Allah's help and fight them".
When we consider all the texts relates to this matter we conclude that the Prophet (Sallallahu Alaihi wa Sallam) and his nation are ordered to raise the rules of Allah high in the earth since the earth belongs to Him and creatures belong to Him. Allah Says (interpretation of meaning) in this concern: "And fight them until there is no more Fitnah (disbelief and worshipping of others along with Allâh) and (all and every kind of) worship is for Allâh (Alone) …}[2:193].
Raising the words of Allah (His religion) would be achieved by three facts:
One, when the people accept Islam as their religion.
Two, when they become subject to this religion by paying Jizyah even if they do not accept it. Of course, they receive some rights against paying Jizyah.
Third, fighting with everyone who resists Islam and is arrogant.
Finally, know that before implementing such rulings of Sharia one should take into consideration the position of Muslim Ummah as far as their strength or weakness is concerned. This is the fact supported by the texts of Qur'an, Sunnah and by the practice of the Prophet Muhammad (Sallallahu Alaihi wa Sallam).
Allah knows best.