This is a gross over simplification of how to do this. Handing money to someone as salary makes it a partial write off for the business, but the employee still has to pay taxes on the money its just at a lower rate than you would IF the money wasn't generated via investments.
You still have to register the entity as a non-profit and you are still required to have transparent bookkeeping and meet the other non-profit requirements.
The lift to do all of this in a way that you can use to avoid taxes also requires some decent liquid capital to statt up and maintaint
Edit: this is Just an FYI for Coli brehs. Gloxina im assuming you posted this as some sort of joke.