When home buyer can cancel sale and get deposit refund

Purchase offers can be contingent on mortgage terms