Deductions & credits

How do I calculate this with the following information?

House A purchased in 2015 with an initial mortgage balance of ~$500,000

House B purchased in 2019 with a mortgage balance of ~$1,000,000.  House A turned into rental property 1/2 way through the year.

 

Is all of the mortgage interest from House A deductible and then the first $750,000 of House B (since purchased 2018 or later)?

Or is all of the mortgage interest from House A deductible and then the first $250,000 from House B?