Copyright licenses specify if and under which conditions you can make modifications to something that is created by someone else and if and under what conditions you can distribute the original or modified versions.
The default copyright 'license' is "all rights reserved", which means that only the original author is allowed to make changes and distribute copies.
Copyright licenses can restrict how you are allowed to use a program, but such restrictions are not accepted in open-source licenses. Having such a restriction in your license automatically makes it a proprietary license.
Open source licenses come in various flavors and choosing one is often a matter of what appeals to you.
- Strong copyleft licenses (like GPL) are based on the ideal that everyone should have the liberty to change/enhance the software that they received a copy of and to distribute those changes. If you distribute software under the GPL license, the source code for the entire application must be available. If someone distributes changes to a GPL program, then those changes must also be distributed under the GPL license (so, including all sources).
- Weak copyleft licenses (like LGPL) are like strong copyleft licenses, but have dropped the requirement that the source code for the entire application must be available. When you distribute code under the LGPL license, the sources for that code must be available and changes to the code must also be released under the LGPL.
If someone wants to use LGPL licensed code in their product, then they must provide a means for their users to replace the LGPL code portions. This is typically done by having the LGPL code in a dynamically linked library.
- Permissive licenses (like MIT, BSD or Apache License) typically lack the requirement that when changes are made, that then the source code for those changes also must be published. They can even allow one to distribute the changed version under a completely different (possibly closed-source) license.
As sole author of the software, you are in the special position that you can choose under which license terms to release the software and even to use different licenses when releasing it to different people. Once you start accepting contributions, those contributions are provided to you under the license terms that the contributor received your software under and you are now also bound by those license terms.
For example, if you have two versions of your software, one licensed under the GPL and the other under a closed-source license, and I contribute a change to the GPL version, then my contribution is also under the GPL license and you can't use it in the closed-source version without my consent to change the license.
As your application appears to be generating code, where a significant portion of the output is code that you have written (regardless of who uses the program), that code is by default under the same copyright license as your program itself.
You can choose to release your program under the GPL license (so your program and any changes to it remain open), but to add an exemption clause that your code that makes it into the output files is not bound by the copyleft provisions.
That way, your program could still be used to create the infrastructure for commercial (closed-source) apps. This wouldn't be possible if the code you output is covered by the GPL.