Quoting from <islam.org>:
It is important to know that suicide is forbidden because of its evil objectives; such as impatience, desperation or any other bad and evil objects. In Jundob Bin Junada’s Hadith, the Prophet (s.a.w.) said: “In the past, there was a wounded man who impatiently cut his hand bleeding to death, Allah said: ‘my slave took the first step to death, he is forbidden to enter Paradise’.” So, killing one’s self this way is “suicide” as it is Islamically pointless, meaningless and intentionally suicidal.
On the other hand, the one who contributes his life to the cause of Allah, Islam and Muslims his doing is sacrificial; he gives his life away for Islam and Muslims, which is the highest sacrifice.
The history of Islam is full of heroic and sacrificial events. It is narrated by Abu Dawood through one of the Prophet’s companions, he said: "***we mounted an attacked on a part of Hunain, one of us followed an unbeliever to kill him, by a mistake killed himself. ***The prophet (s.a.w.) said: ‘O, Muslims… your brother’. We rushed to check him, but found him dead. The Prophet (s.a.w.) wrapped him with his own clothes and his blood on him, then performed the prayer of the dead, the Prophet’s companions asked: is he a martyr? He said: “he is, and I am a witness”. Therefore, the one who blows up the enemies of Allah by blowing up himself as well cannot be considered a suicide, and he is, Allah willing, a martyr.
Killing an unbeliever for any religious cause is not a cause for martyrdom but is simply called–murder. This is horrible and unholy “martyrdom.”