As mentioned above, there are three main types of compound nouns.
A) Spaced or Open Compound Noun
A spaced or open compound noun is one in which there is a space between the two words which form the compound noun.
For example: Cricket bat / Fast food / Flower shop
B) Hyphenated Compound Nouns
A hyphenated compound noun is one in which the two words are separated with the use of a hyphen.
For example: By-product / Mother-in-law / Passer-by
C)Closed or Solid Compound Nouns
A closed or solid compound noun is one in which the two words do not have any spaces or hyphens separating them. They are usually considered as a single word.
For example: Sunflower / Classroom / Rainfall