This question was put to Shaykh Muhammad ibn ‘Uthaymeen (may Allaah have mercy on him) who said:
This questioner mentions in her question that she had done the obligation of Hajj three times. The correct view is that Hajj is obligatory only once in a lifetime, because it was proven that the Prophet (peace and blessings of Allaah be upon him) said: “Hajj is once in a lifetime, and any more than that is voluntary.” So your saying that you have done this obligation three times is a mistake.
With regard to your having done Hajj on behalf of your father who did not pray, the kuffaar do not benefit from righteous deeds, and it is not permissible to seek forgiveness for them, because Allaah says (interpretation of the meaning):
“It is not (proper) for the Prophet and those who believe to ask Allaah’s forgiveness for the Mushrikoon, even though they be of kin, after it has become clear to them that they are the dwellers of the Fire (because they died in a state of disbelief)”
But since your father did pray sometimes, or there is some doubt as to whether he can be regarded as a kaafir, there is nothing wrong with your doing Hajj on his behalf and saying, “O Allaah, give the reward for this to my father if he was a believer.” Connect that to the condition of your father being a believer. There is nothing wrong with that, because making conditions is permissible with regard to matters of worship and du’aa’.
With regard to acts of worship, the Prophet (peace and blessings of Allaah be upon him) said to Dabaa’ah bint al-Zubayr (may Allaah be pleased with her), when she wanted to do Hajj but she was sick, “Do Hajj and make a condition, because your condition is valid with your Lord.” Narrated by al-Bukhaari, 5089; Muslim, 1207.
With regard to du’aa’: Allaah says in the verse on li’aan (interpretation of the meaning):
“And the fifth (testimony should be) the invoking of the Curse of Allaah on him if he be of those who tell a lie (against her)”