Dandruff is defined as excessive scaling of the scalp that results in flaking of our skin. There are many different things that can cause dandruff but the general consensus is that it is a low-grade underlying inflammatory process resulting in proliferative activity of the scalp, meaning there is some kind of inflammation that is leading to excessive scaling. A person with dandruff might see a scalp skin cell turnover of as short as 7 days, whereas someone without dandruff might take up to a month. People with oilier scalps with an excess of oleic acid and a microbe (Pityrosporum species Malassezia ovalis) are more susceptible to dandruff. (The microbe processes the oils and causes an inflammatory response in our stratum corneum.) It's more active in the colder months than the summer.
Dandruff treatments should include anti-microbial agents (like Tinosan or quaternary compounds), keratolytic agents (like salicylic acid or sulfur to increase scalp desquamation) and anti-seborrheic compounds (things that reduce sebum levels, like coal tar).
Because I'm not comfortable making what could be considered drugs or treatments as opposed to cosmetics - for instance, making claims about treating a diagnosable health condition - I won't be offering any recipes for treating dandruff. If you want to make a shampoo suitable for dandruff you'll could start with any shampoo suitable for oily to very oily hair, add some salicylic acid or white willow bark for the keratolytic properties (at 0.1% to 1%), and add some anti-microbial extracts, essential oils, or ingredients.
I have read that people with dandruff should wash their hair more often because of the contribution of sebum to the condition, and even brushing your hair more often might help to exfoliate the scalp.