Praise be to Allah, and peace and blessings be upon the Messenger of Allah. To proceed:
Whoever dies upon Tawhid (Islamic monotheism) without falling into disbelief (kufr) or major polytheism (shirk) is under Allah's will, no matter how great their sins were. This is the belief of Ahl al-Sunnah wa al-Jama'ah.
Whoever sincerely repents to Allah before death, Allah accepts their repentance, erases their sins, and may even replace their evil deeds with good deeds, as Allah says:
"Except for those who repent, believe, and do righteous deeds. For them Allah will replace their evil deeds with good ones."
The one who sincerely repents from a sin is like one who has no sin.
If a Muslim dies without repenting from some major sins, they do not leave Islam as long as they have not fallen into disbelief or major polytheism. Rather, they remain under Allah's will.
The scholars explained that sinful believers fall into three categories:
If a person's good deeds outweigh their sins, Allah may forgive them and admit them into Paradise without punishment.
Allah says:
"As for those whose scales are heavy [with good deeds], they are the successful ones."
These are the people of Al-A'raf, who will remain between Paradise and Hell for as long as Allah wills, after which they will enter Paradise by His mercy.
Those whose sins outweigh their good deeds and deserve punishment are still under Allah's will:
No one who dies upon Tawhid will remain in Hell forever. Eternal punishment is only for the disbelievers.
Yes. A person who commits a major sin that does not reach the level of disbelief remains a Muslim, but their faith is deficient. They are not considered a disbeliever.
Allah referred to a murderer as a brother of the victim's family:
"But whoever is pardoned by his brother..."
Allah also says:
"If two groups of the believers fight each other..."
He still called them believers despite their fighting, which is a major sin.
A believer who dies upon Tawhid will not remain in Hell forever. If they die without repenting from major sins, they are under Allah's will: He may forgive them immediately, or He may punish them according to their sins before admitting them into Paradise. Whoever sincerely repents before death, Allah forgives them, accepts their repentance, and replaces their evil deeds with good deeds.
And Allah knows best.