The inhabitancy of residents is one of the most important studies on social history of Tang and Song Dynasties.This paper discusses the spacial layout of houses with gardens and lands of Tang and the Five dynasties by utilizing Dunhuang documents and Cave Frescoes,and reveals the amount of land owned by the residents is an important factor that affects the spacial layout of houses with gardens and lands.The makeshift houses under equal-field system during the early Tang dynasty,and the hacienda-style houses of Tibetan and Guiyijun regime periods are good examples.Under certain land scale,the Dunhuang residents design their specific spacial layout of houses according to geographic environment,productive requirements and personal preferences,etc.Such as one-courtyard adn two-courtyard houses during the Tibetan period and houses with halls in front of them during Guiyijun regime period.