You'll never be able to keep flies out of your house completely. But You can put up screens on all your windows and make sure any holes are sealed up that flies and other rodents can get through.
Get some of those fly traps where the water traps them in a bag. I use them both in my house and outside my house to kill flies.