He did tawaaf al-ifaadah when he was junub
Question

                A pilgrim became junub on the night before ‘Arafah and he continued with his Hajj until he completed it, then he went back to his country. What does he have to do?
Praise be to Allah.
    There is grave major sin on this person 
    because he continued for all these days praying without being in a state of 
    purification. The Prophet (blessings and peace of Allah be upon him) said: 
    “Allah does not accept any prayer without purification.” What he must do 
    with regard to his prayers is repeat all the prayers that he did before 
    doing ghusl. 

    With regard to Hajj, he has to repeat 
    tawaaf al-ifaadah, because he did tawaaf when he was in a state of janaabah, 
    and tawaaf is not acceptable from a person when he is in a state of janaabah. 
    That is because the one who is in a state of janaabah is not allowed to stay 
    in the mosque, as Allah, may He be exalted, says (interpretation of the 
    meaning): “O you who believe! Approach not As-Salat (the prayer) … nor 
    when you are in a state of Janaba, (i.e. in a state of sexual impurity and 
    have not yet taken a bath) except when travelling on the road (without 
    enough water, or just passing through a mosque)” [an-Nisa’ 4:43]. If he 
    was married, he should avoid intimacy with his wife until he goes back to 
    Makkah and does tawaaf al-ifaadah. In that case he should enter ihram for 
    ‘umrah from the miqaat, then do tawaaf and sa‘i and cut his hair, then do 
    tawaaf al-ifaadah. In addition to all that, he must also repent to Allah by 
    regretting what he did and regarding himself as having fallen short and 
    neglected the rights of Allah, and he should resolve not to do such a thing 
    again. End quote.