Of course, there are ants powder you can buy, but what has worked for me is a simple and cheap solution. I put salt on the threshold outside the door to stop them coming inside. Just place a line of salt outside your door and window sill (if the ants come in from there).
You have to re-apply if it rains. This is funny, but like in vampire movies, if there's a break in the salt line the ants will walk through this. Check it daily.
You really can't stop them from hanging around the yard. This is where they live (like all other insects). If they're too bothersome you can use salt or ants powder.
Anne's the author of How To Spend Less and How to Teach Kids to Be Responsible Adults. She blogs on http://getconfidence.net and http:ourdiyprojects.net