The damage a building receives during an earthquake depends on a number of factors below that are in ALL CAPS:
BUILDING CONSTRUCTION -- Wood-framed homes generally fare better than masonry, especially if masonry isn't reinforced. Most modern buildings, built after 1975, should be survivable, which means that they will stand up long enough for people to survive and evacuate.