Praise be to Allah.
Using shampoo and soap when doing ghusl as prescribed in sharee‘ah, such as ghusl in the case of janaabah, is not obligatory; rather it is sufficient for the Muslim to pur water over his body so that it reaches every part of it, as we explained in the answer to question no. 163826. In the answer to question no. 83172 you will find a description of complete and acceptable ghusl.
If a person wants to use shampoo and soap when doing his obligatory ghusl, there is nothing wrong with his washing his body with water and shampoo in order to clean it, then doing ghusl as prescribed in sharee‘ah, with water only. There is nothing wrong either with him intending to do ghusl for janaabah with the water with which he is removing the shampoo and soap with which he has cleaned his body, so that he makes water reach his whole body only once, combining the two matters.
Shaykh ‘Abd al-‘Azeez ibn Baaz (may Allah have mercy on him) was asked:
I did ghusl for janaabah using soap and shampoo; does this ghusl count for wudoo’ too, if that was my intention?
He replied: That will count for both if you intended both types of purification. But it is preferable to do wudoo’ first, then to do ghusl, as the Prophet (blessings and peace of Allah be upon him) did, because that is more complete. There is nothing wrong with using soap or shampoo or lotus leaves and the like in order to remove dirt.
End quote from Fataawa ash-Shaykh Ibn Baaz, 10/173
And Allah knows best.