A historic city centre building is set to be turned into housing after the council selected a buyer.