To keep centipedes away from a home, make sure that the foundation of the house is not constantly damp. Check to see if there are any cracks in it, and repair them to prevent insects from entering the house through the cracks. Make sure that the outside doors are closed at all times. Another preventive measure is to apply a pesticide to the foundation of the house and around it to create a barrier against insects.
In addition, to prevent centipedes away from a home, get rid of all the other pests, insects in particular, that may be living in the house. Insects are a source of food to centipedes. In addition to keeping the foundation of the house dry, use a dehumidifier to clean up all the other damp places that may be in the house, and put packets of silica in them to absorb moisture. Don't keep organic material, such as firewood, mulch, tarpaulins and compost bins, close to the house, as centipedes that live in those places might get inside the house.
Applying weather stripping to the outside of the walls of the house can also help to prevent centipedes from entering. Make sure that all the gutters and downspouts are clean and that nothing is keeping water from flowing freely. Placing thin strips of cayenne pepper along the entry ways to the house is also helpful in keeping centipedes away.