Sold home Jul 2020 then bought new home Dec 2020. The int paid for sold home was $19,774. The int for new home was $920. How to calculate deductible mort interest?

Tried using for 14900 to calculate and the additional mortgage in December reduces my deductible interest by more than $7k.  How to incorporate 5 months without a mortgage.  First mortgage prior to 2017.