When you use open source as a noun, do not hyphenate.
For example:
Open source allows universal distribution of a code.
Use the hyphen
When you use open source as an adjective, use the hyphen.
For example:
Open-source code is available to the general public to use and modify.