The best longest-lasting form of rat & mice control in homes is sealing & exclusion. Rodents can get into entry points that are 1/4″ or larger so sealing cracks and openings in foundations and any openings for water pipes, electric wires, sewer pipes, drain spouts, and vents is a must. Make sure doors, windows, and screens fit tightly. Their edges can be covered with sheet metal if gnawing is a problem. Hardware cloth, wire screen, and lightweight sheet metal are great materials for plugging up gaps and holes. Rats can gnaw away wood, caulking & expandable foam, so they are not as durable.
Rats can climb very well so openings/vents on the roof and roof line can’t be overlooked. Sometimes trimming back tree limbs that touch the roof line and keeping wood/rock piles and compost heaps away from the house can help as well. Ideally, entry points should be closed up before you have a rodent problem so that baiting or costly trapping will not have to be done first. While rodents do tend to seek shelter from the cold, if there are suitable entry points they can become a problem quickly anytime of the year.