إنما ينهاكم الله عن الذين قاتلوكم في الدين وأخرجوكم من دياركم
وظاهروا على إخراجكم أن تولوهم
It is only as regards those who fought against you on account of religion, and have driven you out of your homes, and helped to drive you out that Allah forbids you to befriend them.
means, `Allah forbids you from being kind and befriending with the disbelievers who are openly hostile to you, those who fought against you, expelled you and helped to expel you. Allah the Exalted forbids you from being their friends and orders you to be their enemy.'
Then Allah stresses His threat against being friends with them, by saying,
ومن يتولهم فٲوليك هم الظالمون
And whosoever will befriend them, then such are the wrongdoers.
As He said;
يٲيها الذين ءامنوا ﻻ تتخذوا اليهود والنصرى أولياء بعضهم أولياء بعض ومن يتولهم منكم فٳنه منهم إن الله ﻻ يهدى القوم الظلمين
O you who believe!
Take not the Jews and the Christians as protecting friends, they are but protecting friends of each other. And if any among you takes them (as protecting friends), then surely, he is one of them.
Verily, Allah guides not those people who are the wrongdoers. (5:51)