Praise be to Allah.
The believer is enjoined to do wudu properly . This was the command of the Prophet (peace and blessings of Allah be upon him) who said: “Do wudu properly, make water reach between the fingers and toes, and rinse the nose very thoroughly, except when you are fasting.” (Narrated by al-Tirmidhi, al-Sawm, 788; Abu Dawud, 142; classed as sahih by al-Albani in Sahih Sunan al-Tirmidhi, 631)
So he (peace and blessings of Allah be upon him) pointed out that we should avoid excessive rinsing of the mouth and nose when fasting , lest that lead to the thing which is forbidden, namely water getting into the throat whilst fasting .
As for simply rinsing out the mouth whilst fasting, there is nothing wrong with that so long as the water does not enter the throat of the fasting person .
Hence it was narrated in a sahih hadith that ‘Umar ibn al-Khattab said: “I kissed (my wife) whilst I was fasting . I said, ‘O Messenger of Allah, today I did something grievous, I kissed whilst I was fasting.’ He said, ‘What do you think about rinsing your mouth whilst you are fasting?’ I said, ‘There is nothing wrong with it.’ He said, ‘Then what’s wrong?’” (Narrated by Abu Dawud, al-Sawm, 2037; classed as sahih by al-Albani in Sahih Sunan Abi Dawud, no. 2089)
The commentator on this hadith said concerning the words, ‘What do you think about rinsing your mouth whilst you are fasting?’, this is a sign of brilliant understanding, for rinsing the mouth does not invalidate the fast and it is the first step towards drinking.
And Allah knows best.