The short answer
Carl Jung wrote about same-sex attraction in a few essays and letters. He did not set out a single, systematic account of it. His statements are mixed, some are dated, and some describe same-sex attraction in ways modern psychology does not support. Today, psychology does not treat homosexuality as an illness.
Where Jung wrote about it
Jung touched on the topic in several places rather than in one book. Readers who look for his views will find scattered remarks in essays, letters and comments made during lectures. Because they are not gathered in one place, it is easy to take one passage as his final word. Reading the surrounding text helps.
Views that read as dated
Some of his remarks link same-sex attraction to family relationships or to an imbalance in the psyche. Some lean on stereotypes that modern readers find outdated. These passages are often the ones quoted online, so it is worth reading them in context before deciding what they mean.
Where the field stands now
The American Psychiatric Association removed homosexuality from the Diagnostic and Statistical Manual of Mental Disorders in 1973. The World Health Organization removed it from the International Classification of Diseases in 1990. Current psychology and psychiatry do not classify same-sex attraction as a mental disorder.
Jung’s views on this topic are therefore not the current professional consensus, even where his wider work remains influential.
Keeping his dream work and his views separate
A reader can judge Jung’s dream methods and ideas on their own merits without accepting every view he expressed about sexuality. The two are separate questions. For a comparison of how Jung’s dream work relates to Freud’s, see sigmund freud and carl jung interpretation of dreams.
Where to read his words
Read his writing in context, and compare translations, since the English wording depends on the translator. Secondary scholarship that explains the historical background can help you judge which passages were central to his thinking and which were passing remarks.