Ants are difficult to control, and once you have an infestation, eradicating it can take weeks. That's why it's better to keep them from coming around in the first place. Among the deterrents you can employ are planting herbs that ants don't like and putting out bait, but treating the soil around your house or garden will provide more immediate relief. The best soil treatment penetrates deeply and remains effective for more than just a few days, plus it won't hurt animals or children -- just ants. A two-step soil treatment will control most ant species.
Pour a gallon of orange oil-based insecticide into a garden sprayer. The active ingredient in this product is orange peel extract, or d-Limonene. It kills ants by interfering with their respiratory systems, but is completely nontoxic for humans and animals.
Spray the soil generously with the insecticide. To be effective for an extended period, it must sink deep into the ground. It is water-soluble, so if you have a large area to cover, you can dilute it with 3 parts water to 1 part product without reducing its effectiveness.
Sprinkle the surface of the soil with diatomaceous earth the day after you spray it. Even though the orange oil acts as a repellent, it may penetrate unevenly, and diatomaceous earth will eliminate any new scouts. A powder formed from ground algae, it desiccates and lacerates ants that walk through it, while being completely nontoxic to pets and people. It is also inexpensive.
Repeat the spray treatment as soon as you see ants again. Because orange oil is water solvent, you may have to spray again after a heavy rain. Let the soil dry out before you do. You should also spread new diatomaceous earth after a heavy rain.