It is very significant for rural planning to accurately count the number and area of rural homesteads by means of automation. The development of deep learning makes it possible to achieve this goal. At present, many effective works have been conducted to extract building objects from VHR images using semantic segmentation technology, but they do not extract instance objects and do not work for densely distributed and overlapping rural homesteads. Most of the existing mainstream instance segmentation frameworks are based on the top-down structure. The model is complex and requires a large number of manually set thresholds. In order to solve the above difficult problems, we designed a simple query-based instance segmentation framework, QueryFormer, which includes an encoder and a decoder. A multi-scale deformable attention mechanism is incorporated into the encoder, resulting in significant computational savings, while also achieving effective results. In the decoder, we designed multiple groups, and used a Many-to-One label assignment method to make the image feature region be queried faster. Experiments show that our method achieves better performance (52.8AP) than the other most advanced models (+0.8AP) in the task of extracting rural homesteads in dense regions. This study shows that query-based instance segmentation framework has strong application potential in remote sensing images.