The main characteristic of a compound word is that it can be divided into two words, both of them can exist independently as English words (example: sunrise – it is formed from "sun" + "rise"). Of course, there are compound words that are made of more than two words.
Back to the stress placement, the question is only one: When is the primary stress placed on the first word of the compound and when on the second?
The most common type of compound word is the one that combines two nouns. This type of compound word usually has the stress on the first word of the compound.
Typewriter /ˈtaɪpˌraɪ tər/
Compound words that are formed of an adjectival element and the "–ed" morpheme at the end receive stress on the last word of the compound. Also, compounds in which the first element is a number tend to get the stress on the final element.
Compound words that function as adverbs are mostly final-stressed. Also, compound words which function as verbs and have an adverbial first element get the stress on the final element.