86وَإِذَا حُيِّيتُم بِتَحِيَّةٍ فَحَيُّوا۟ بِأَحْسَنَ مِنْهَآ أَوْ رُدُّوهَآ ۗ إِنَّ ٱللَّهَ كَانَ عَلَىٰ كُلِّ شَىْءٍ حَسِيبًا
87ٱللَّهُ لَآ إِلَـٰهَ إِلَّا هُوَ ۚ لَيَجْمَعَنَّكُمْ إِلَىٰ يَوْمِ ٱلْقِيَـٰمَةِ لَا رَيْبَ فِيهِ ۗ وَمَنْ أَصْدَقُ مِنَ ٱللَّهِ حَدِيثًا
[86-87] And when anyone greets you in a respectful manner, greet him with a better salutation than his or at least return the same;114 indeed Allah takes count of everything. Allah: there is no deity but He. He will gather you all together on the Day of Resurrection, the coming of which is beyond all doubt: and whose word can be truer than Allah's.115
114The Muslims were specially exhorted to be very civil and polite to the non-Muslims because at that time their relations were strained on account of the conflict between them. In that state of tension, they were forewarned to be on their guard against incivility and impoliteness. They were, therefore, taught to be equally civil and polite to them when they greeted them respectfully. Nay, they should be even more civil and polite than their opponents.
Harsh behavior and harsh words do no good to anyone but they are specially unsuited to the work of those missionaries of Allah's Message, who have dedicated themselves to one day invite the world to the Truth and exerted themselves to reform the ways of the people. Such ill behavior may satisfy one's vanity, but it does great harm to one's mission.
115That is, "The misbehaviour of the unbelievers, atheists, polytheists and the like can do no damage to the Godhead of Allah, for they cannot alter the fact that He is the One and All-Powerful Sovereign, and that, one day He will assemble together all human beings and deal with them in accordance with their deeds and none will be able to escape from His retribution. Therefore, Allah does not stand in need of anyone to defend Him against His rebels by showing incivility and impoliteness to them.
That is the bearing of this verse on the preceding verse. But this verse also serves as an appendix to the passage that began from verse 60. In that case it means: Let any body follow any way he chooses and work in any way he likes in this world but he should not forget that one Day everyone shall have to go in the presence of Allah Who is the sole Sovereign. Then everyone shall see the result of his actions and deeds.