From what I hearing from friends in America who are following this intensely - he was unpopular and bullied in school, gun-rights fruitcake and possible victim of bullying at home. Ticks pretty much all the boxes you'd expect of a high-school shooter, suicide-by-cop that they've kinda gotten used to analysing over the last few decades.
It could be as simple as suicide-by-cop with a desire for infamy; but deciding on Trump versus body-count of children.
Of course, I'm not saying that it is, but from what I hear, he fits the profile.