In English you can take a noun and use it as a qualifier for another noun, thus taking the role of an adjective. The examples above, race car and tree house are exactly that. They do not require hyphens.
If you have a noun phrase acting as modifier, than you may want to add a hyphen to the first two words to avoid confusion, so that the first two words are parsed together as modified for the third. Sometimes this is not needed because the first two words already have a recognized meaning, as in boy scout leader. In principle, this may mean a leader of boy scouts (the typical meaning) or a leaders of scouts, who happens to be a boy (not the intended meaning) which is not what most people would understand, by the mere fact that boy scout is itself a typical compound word.
In general, hyphenation and other punctuation is a matter of style, so you may get different answers from different people. And moreover as a hyphenated form becomes frequent the hyphen may be dropped to form a compound word in so-called closed form.