Hello and thank you for posting your health query on E health Forum.
Based on the history, it seems that you might be having seborrheic dermatitis.
Seborrheic dermatitis is a common, inflammatory skin condition that causes flaky, white to yellowish scales to form on oily areas such as the scalp.
Seborrheic dermatitis is thought to be due to a combination of an over production of skin oil and irritation from a yeast called malessizia.
For treatment you can use OTC dandruff or medicated shampoos. Shampoo the hair vigorously and frequently (preferably daily). Loosen scales with the fingers, scrub for at least 5 minutes, and rinse thoroughly.
Shampoos or lotions containing selenium, ketoconazole, or corticosteroids may be prescribed for severe cases by your doctor.
I hope this helps.