It seems that you are having seborrheic dermatitis
There is no exact cause.
There may be tendency to develop SD.
But, some factors may precipitate SD.
,enviormental factors,yeasts on scalp,vitamin deficiencies...etc may cause SD
Due to dandruff
, your hairs are falling.
Avoid worries and tension.
Take proper sleep.
Have nutritious diet.
Take antifungal tablets.
Steroids in tappering dose for short period may be helpful.
Antibiotics may be taken ,if there is bacterial infection.
Biotin containing tablets should be taken to stop hair loss.
Apply antifungal with steroid lotion on scalp.
Shampoo with ketoconazole
You consult dermatologist
for perfect treatment.
I think, you might be satisfied with my answer.
Dr. Ilyas Patel MD