The most common gnats within a home are fungus gnats, which claim soil from plants as their habitat. Gnats inside a home can also be due to having fruit flies and/or phorid flies.
Fungus Gnats are black and maggot-like, and they often collect near windows. These gnats are not harmful to the plant's roots. One distinction to separate fruit flies and phorid flies from the fungus gnats is their color, brown. Fruit flies are specifically attracted to kitchen areas, and a dish full of vinegar can eradicate them. The fruit flies like vinegar and get stuck inside the dish. Phorid flies are actually from the sewer and plumbing lines, which can indicate a sewer or septic tank issue.