Deductions & credits

Say I start the year 2020 with a mortgage loan (that was refinanced in a previous year) of $600,000.  Then say in July 2020 I refinance the loan.  The $600,000 is paid off and the refinanced loan is again say $600,000.  When determining if the loan amount (to figure deductible mortgage interest) is over the $750,000 limit do you add the 2 loans together and use the total ($1200,000) or do you add the 2 loans together and divide by 2 ($600,000).  Of course in the first case $1,200,000 is above the $750,000 limit for couples, but in the second case the $600,000 average is well below the limit.  Turbotax adds them together.  Isn't it true that you should use the average instead of the total?