Sanskrit compound
Sanskrit inherits from its parent, the Proto-Indo-European language, the capability of forming compound nouns, also widely seen in kindred languages, especially German, Greek, and also English. However, Sanskrit, especially in the later stages of the language, significantly expands on this both in terms of the number of elements making up a single compound and the volume of compound-usage in the literature, a development which is unique within Indo-European to Sanskrit and closely related languages. Further, this development in the later language is an entirely artificial, literary construct and does not reflect the spoken language. Background
In Sanskrit, as in Proto-Indo-European, a compound is formed by the following process:

 Take the stem-form of the first element, i.e., remove its inflexion;
 Combine the two elements with a single accented syllable. In the later language, this process can be repeated recursively—in theory, ad infinitum, with the freshly made compound becoming the first element of a new one. The process of 'resolving' the compound, i.e., expounding the meaning using the component words declined as in sentence form is termed vigraha·vākya. Broadly, compounds can be divided into two classes: endocentric and exocentric. Endocentric compounds
An endocentric compound, usually called determinative, is where the compound is essentially the sum of its parts, the meaning being an extension of one of the parts:

 blackbird → a type of black bird
 White House → the official residence of the US president
 siṃha·purás → lion-city (Singapore)

Exocentric compounds
An exocentric compound refers to something outside the components:

 redhead → someone with red hair
 pickpocket → someone who picks someone else's pockets
 'bahu·vrīhi' → lit. 'much-rice', i.e., possessing much rice: an indication of wealth

Indeed, this term 'bahuvrihi' is used both in Sanskrit and standard Indo-European linguistics to denote this type of compound. Sanskrit expands on these to provide several further distinctions as below:

Classification
Traditionally, Sanskrit compounds are divided into the following main classes:

 Tatpuruṣa
 Tatpuruṣa proper
 Karmadhāraya
 Dvigu
 Nan tatpuruṣa
 Prādi and gati
 Upapada 
 Bahuvrīhi
 Dvigu
 Dvandva
 Avyayībhava

The first two of these, tatpuruṣa and bahuvrīhi, are Indo-European inheritances, the latter two are Indic innovations. Alongside the term bahuvrīhi, tatpuruṣa has also been adopted in mainstream Indo-European linguistics as the technical term denoting this type of compounding. The following sections give an outline of the main types of compounds with examples. The examples demonstrate the composition of the compound's elements, and the meanings in English generally correspond to them, in most cases being a similar compound as well. Where this is not the case or the meaning is not clear, a further resolution is provided. Tatpuruṣa (determinative)

A tatpuruṣa is an endocentric compound composed of two elements, wherein the first one, named the attributive, determines the second one. Based on the grammatical nature of the attributive member, six varieties of tatpuruṣa compounds are identified as seen in the classification above. A further distinction is also made based on whether the attributive is in the nominative or an oblique case. Tatpuruṣa proper 

The first member here is an attributive in an oblique relationship with the second, and are therefore termed dependent determinatives. Karmadhāraya-tatpuruṣa (descriptive) 
In a karmadhāraya-tatpuruṣa compound, the first element qualifies the second one adjectively when the latter is a noun. When the second member is an adjective, the qualification is adverbial. Other parts of speech besides adjectives and adverbs may be used to obtain the adjective or adverbial qualification. Dvigu-tatpuruṣa (numerative) 

In essence dvigu can refer to several compound types where the first element is a numeral. Dvigu-tatpuruṣa compounds are a special subcategory of karmadhārayas. dvigu compounds of bahuvrīhi type are noted below. Nañ-tatpuruṣa (negative) 
In a nañ-tatpuruṣa compound, the first element is a privative, a negator: a-, an- or na-, just like the English un-, Latin-derived in-, non- or Greek-derived a-, an-. Upapada-tatpuruṣa 

These are composed of a second member that occurs only in a compound and cannot stand on its own. These are either roots or verbal derivatives from them. Aluk-tatpuruṣa 
In an aluk-tatpuruṣa compound, in contrast to the standard pattern of being in stem form, the first element takes a case form as if in a sentence:

Dvandva (co-ordinative)
These consist of two or more noun stems connected with "and" (copulative or co-ordinative). There are mainly three kinds of dvandva pair constructions in Sanskrit:

Itaretara-dvandva
The result of itaretara-dvandva is an enumerative word, the meaning of which refers to all its constituent members. The resultant compound word is in the dual or plural number and takes the gender of the final member in the compound construction. Examples:

Samāhāra-dvandva
Words may be organised in a compound to form a metonym, and sometimes the words may comprise all the constituent parts of the whole. The resultant bears a collective sense and is always singular and neutral. Ekaśeṣa-dvandva 
According to some grammarians, there is a third kind of dvandva, called ekaśeṣa-dvandva, where only one stem remains in the compound of multiple words. Āmreḍita (iterative) 

While not strictly copulative, this is a compound consisting of the same word repeated with the first occurrence accented. Āmreḍita compounds are used to express repetitiveness; for example, from dív- (day) we obtain divé-dive ('day after day', daily) and from devá- (god) we obtain deváṃ-devam or devó-devas ('deity after deity'). Bahuvrīhi (possessive)

Bahuvrīhi is an exocentric compound consisting of a noun preceded by a grammatical modifier which, taken together, functions as a single nominalised adjective. A bahuvrīhi compound can often be translated by "possessing..." or "-ed"; for example, "possessing much rice" or "much-riced". In English, examples of bahuvrīhi would be "lowlife" and "blockhead" (they respectively denote 'one whose life is low' and 'one whose head resembles a block'), or the English surname Longbottom ('one who lives in a long "botham" [valley]'). The second element could essentially have been a noun, which within such a compound, can take on adjective declensions with the compound used adjectivally. Endocentric compounds can thus be transformed into possessives, normally accompanied, and explicitly recognized in the older language, by a change in accentuation:

 indra·śatrú-, 'Indra's killer' ⇒ índra·śatru-, 'having Indra as killer'
 bṛhad·ratha-, 'a great chariot' ⇒ bṛhád·ratha-, 'having great chariots'
 sūrya·tejás-, 'sun's brightness' ⇒ sū́rya·tejas-, 'possessing the brightness of the sun'

A few typical examples of such compounds:

Dvigu-bahuvrīhi 
When the first element of a bahuvrīhi is a numeral, the compound is called dvigu. An English example would be a halfwit ('one who has half of their mind'). A few typical examples of such compounds:

Avyayībhāva (adverbial)
Avyayībhāvas ('indeclinable') are adverbial compounds composed of an indeclinable element (an adverb, etc.) and a noun, together expressing an adverb or another indeclinable () element. See also
Sanskrit nominals
Sanskrit verbs
Sanskrit grammar
Vedic Sanskrit grammar
Proto-Indo-European verbs
Proto-Indo-Aryan
Proto-Indo-Iranian
Proto-Indo-European
Kenning

Notes

References

Bibliography
 
 
 
 
 
 
 
 
 
 
 
 
 

Sanskrit grammar
Vyakarana
Linguistic morphology