As for the pilgrimage, it does not expiate abandoning the prayer, nor does it expiate abandoning the fast, for these are ruinous major sins that Hajj does not erase.
Likewise, if you performed the Hajj while you were not praying, it is invalid, because a person who does not pray has no religion and no Islam, and none of his deeds are accepted until he repents to Allah. If, however, you repent to Allah with a genuine repentance and thereafter keep up the prayer, that will wipe out what came before. You must therefore be truthful, persist in your repentance, and give the prayer the attention it deserves.
If you performed the Hajj during a period when you were neglecting the prayer, you must repeat it. But if you performed it after you had repented, then, if Allah wills, your Hajj is sound, and what has passed of disobedience—abandoning the prayer and failing to fast—is expiated by sincere repentance.
Abandoning the Prayer out of Laziness
Question: My father—may Allah have mercy on him—passed away after suffering from a prolonged mental illness. During that illness he neither fasted nor prayed, and even before falling sick he would often neglect the prayer out of laziness. I fear for him the punishment of Allah, so I constantly supplicate for him in my prayers. Is it permissible for me to pray or fast on his behalf, making up what he missed of obligatory fasting and prayer during his life?
Answer: If your father deliberately abandoned the prayer and remained in that state until he died, his situation is grave and it is feared that he has fallen into disbelief, for whoever abandons the prayer while denying its obligation is, by the consensus of the Muslims, a disbeliever, and whoever abandons it out of laziness