Complementary distribution is the distribution of phones in their respective phonetic environments such that one never appears in the same phonetic context as the other. When two variants are in complementary distribution, one can predict where each will occur because one can simply look at the environment in which the allophone is occurring.
Complementary distribution is commonly applied to phonology, where similar phones in complementary distribution are usually allophones of the same phoneme. For instance, in English, and are allophones of the phoneme /p/ because they occur in complementary distribution. always occurs when it is the syllable onset and followed by a stressed vowel (as in the word pin). occurs in all other situations (as in the word spin).
There are cases where elements are in complementary distribution, but are not considered allophones. For example in English and are in complementary distribution, since only occurs at the beginning of a syllable and only at the end. But because they have so little in common in phonetic terms they are still considered separate phonemes.
The concept of complementary distribution is applied in the analysis of word forms (morphology). Two different word forms (allomorphs) can actually be different "faces" of one and the same word (morpheme). For example, consider the English indefinite articles a and an. The usages an aardvark and a bear are grammatical. But the usages *a aardvark and *an bear are ungrammatical (marked with "*" in linguistics).
The forms an and a function to work together like a team, in order to take care of every instance (environment) where the English indefinite article is needed. This is why we say that they are two different "forms" of the same "word", instead of saying that they are "two different words".