2 years ago I developed a small nodule under the skin on the back of my head. Since then masses over my temples, and off and on pustles all over scalp?

Many possibilities. Several issues here. Sounds like an abscess that has since perpetuated itself by pustules that begin in the follicles. Consider: folliculitis with mrsa, tinea capitis, or other fungal infection. You liekly were treated with many different anti-infectives, but was the source of infection addressed? Recurrence o might be due to exposure to a contaminated site. Auto-immune causes are also possible.