Habitat is the general place where an organism lives
Niche is the range of physical and biological conditions in which a species lives and the way the species obtains what it needs to survive and reproduce.
Multiple organisms may try to be using resources from a limited environment which causes competition among organisms. Competitive exclusion principle states that no two species can occupy exactly the same niche in exactly the same habitat at exactly the same time. Species will normally divide the resources. Competition usually determines the kind of species that the resources will be divided with.
Look: