HOW CAN A PERSON KNOW IF ALLAH (SWT) FORGAVE HIM BEFORE HE DIES?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Dear brother, Allaah is the Oft-Forgiving, the Most Merciful, the Compassionate and the Most Benevolent. Allaah likes forgiving and accepts the repentance of His slaves. He, the Exalted, stretches His Hand during the night so that those who commit sins by day may repent, and He stretches His Hand in the day so that those who commit sins by night may repent. Not only this, but Allaah also calls on his slaves every night before dawn asking who is supplicating Him so that He may answer him? Who is asking him for something so that He may give it to him? Who is seeking His forgiveness so that He may forgive him?
Allaah guides his slaves to many ways by which they could become near to Him and could get rid of their sins. He has made all these ways easy for His servants. All these matters have been proved through many sound Hadeeths. When a Muslim recognizes these facts and believes in them, he might know when Allaah would forgive him. When a Muslim realizes his monotheist faith in Allaah, believes in His promises and threats, makes a sincere repentance and continues asking forgiveness of Allaah, then surely Allaah will forgive his sins, even if he commits very many, provided that he does not stubbornly insist on committing them. The Prophet Muhammad, sallallaahu ‘alayhi wa sallam stated: "If a slave commits a sin and then says, 'O my Lord, I have sinned, please forgive me’, his Lord Says: 'My slave knows that he has a Lord who forgives sins and punishes for them, I therefore have forgiven My slave (his sins).’ Then he remains without committing any sin for a while and then again commits another sin and says, 'O my Lord, I have committed another sin, please forgive me,' and Allaah Says: ‘My slave knows that he has a Lord who forgives sins and punishes for them, I therefore have forgiven My slave (his sins).'Then he remains without committing any other sin for a while, and then sins and says, 'O my Lord, I have committed another sin, please forgive me’, Allaah Says: ‘My slave knows that he has a Lord who forgives sins and punishes for them. I therefore have forgiven My slave (his sins), he can do whatever he likes.’" The sentence: "He can do whatever he likes," means that Allaah will continue forgiving His slave as long as he continues asking Allaah's forgiveness.
Allaah Knows best.
You can search for fatwa through many choices