-->
If a Muslim commits a major sin (such as intentional killing or adultery) and dies without repenting, they will be punished in Hell according to the severity or magnitude of the sin, then eventually be taken out of Hell. No Muslim will stay in Hell forever.
What is mentioned here is the punishment in the Hereafter. The legal consequences, enforceable by human society, are mentioned in ii. 178, under the rules of Qisas. That is, a life should be taken for a life destroyed, but this should be on a scale of equality: a single murder should not commit a whole tribe to a perpetual blood-feud, as in the days of ignorance. But if the heirs of the man slain accept reasonable compensation, this should be accepted, and the taking of a life for a life should be put a stop to. This course leads to the saving of life, and is commanded to men of understanding.