You must structure the loan with a "partial release" clause to allow the selling of one of the properties. Without it, the entire balance of the mortgage is due upon sale.