Different types of rats prefer different habitats. Some rats are skilled climbers and spend their time in trees and on the roofs of buildings. Other rats like to keep their feet on the ground and burrow under things like woodpiles, foundations, and construction debris.
If they decide to move indoors and use our homes as a place of refuge, they retreat to areas that offer them a dark, dry, quiet environment like attics, basements, the backs of closets, wall voids, and crawl spaces.