My husband always had terrible dandruff, Head and Shoulders and Neutrogena etc worked for a week or two and then he was back to square one.
The thing that worked and he's not had it for over 30 years now, was changing to sulphate free shampoo. I think that the Sodium Lauryl sulphate and/or Sodium Laureth sulphate was stripping his scalp too much and causing the dandruff.
I've used sulphate free shampoos for years as those containing sulphates make my head itch, I let my hair dry naturally when I wash it and I also go to bed with wet/damp hair and I don't ever have dandruff. I use an exfoliating treatment about once a month and have silk pillowcases, they're great for hair and face. My hairdresser always says that my hair is in really good condition, it's long and I only get it cut 2-3 times a year.