If you have any live potted plants in your house those potted plants can attract gnats and gnats will breed and live in the potted plant soil.
Gnats are also attracted to anything moist and even food or fruits laying around. If you have any fruits you should put the fruits in the refrigerator to keep the gnats away.
Dry out any moist or damp areas too since the gnats are attracted to damp locations.