In this verse, the words “Awliya”- plural- or “wali” – singular- has been (badly) translated as “friends” or “friend”; however, the more appropriate translation would be a “guardian, protector, or advocate”. Muslims are to be advocates and protectors for each other. And friends with everyone.
Muhammad was kind to the pagans of Mecca and fought them only when they fought him. He made treaties with the Jews of Madinah and honored the treaties until they broke them. He received the Christians of Najran with kindness in Madinah. They argued with him about Islam, but he treated them with honor and respect.
Some translate this verse to mean that Muslim should not take the Jews and the Christians for friends who are exclusively friends of each other at the exclusion and detriment of the Muslims, as is seen in Zionism and the Islamophobic lobby.