Well, if the buildings have collision shapes, you can use the intersect_point
function to detect overlaps and call the function on each corner of the building you want to place or something like that. As long as your buildings are not big enough that another building could fit in it without touching the corners and/or center, then it should work okay.
If you want to see if the entire shape is not colliding with something, you probably want to use the intersect_shape
function (documentation) or use an Area2D node and the get_overlapping_bodies
function (documentation).