It can be due to dandruff or seborrheic dermatitis. Topical antifungals and mild steroids are the usual treatment and combination of the two can be used to treat stubborn patches. Oral antifungal drugs and immunomodulators such as tacrolimus and pimecrolimus are used in very severe cases. You should get them prescribed from your doctor.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care.