All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad, sallallaahu`alayhi wa sallam, is His slave and Messenger.
A woman knows the purity (Taharah) after menses by one of two signs: Either by white Al-Qassah, which is a discharge that tends to be whitish in color and comes out after the menstrual blood has ended or by complete dryness, and it is inspected by inserting cotton into the place, and which comes out clean without any trace of blood, yellowish or brownish.
If you saw purity with one of these two signs, then take Ghusl, and if you come back and see red blood after that, then you are considered still menstruating and take Ghusl after it stops, as long as it is within the maximum duration of menses as mentioned in the question. But if after seeing your purity, you see a yellowish or brownish discharge, then you should not concern yourself about it and do not count it as menstruation.
Allah knows best.