DDL trigger will add a user to a newly created database and assign db_owner role. It can be modified for what role is required.
1. Copy and paste the code on managment studio
2. Make sure you change the @username to the name you want
3. Make sure the username exists
4. run create database <db_name>
5. check if the user is added to the role in the created databse