Given that the median age of mass shooters is 33 (https://rockinst.org/gun-violence/mass-shooting-factsheet/), restricting gun ownership among young men is not likely to have a major impact on mass shootings as a whole. In more detail: roughly 10% of the male population is between the age of 18 and 25, while they commit 20% of the mass shootings...not negligible, but not overwhelmingly disproportionate (~2x risk, only some of which can be mitigated by making gun ownership illegal).
However, as schools are disproportionately the target of young (under 25) individuals who have a proclivity for assault-style weapons, and a sizable number of them (>50%) do obtain weapons legally (https://www.liebertpub.com/doi/10.1089/vio.2018.0021), simply making gun ownership illegal under ordinary circumstances among under-25s might make a substantial impact on school shootings.
But there is, unfortunately, little reason to believe that this would have a major impact on mass shootings overall. Even a minor impact may be worth it, but it's worth considering the advantages, drawbacks, and likelihood of success.