Calculation of 2nd home mortgage deduction over 750K

Hi,

 

My primary house was purchased in 2016 with 500K mortgage loan today.

 

I am considering to purchase a 2nd home for the expanded family with 400K mortgage loan. 

 

Of course, the interest today is much higher than it was in 2016. So how much interest can I deduct for federal tax?

 

1. I can deduct the interest generated from both loans and then can deduct: total interest * 750K/(500K + 400K)

 

2. I can deduct the primary home (purchased earlier) interest and then part of 2nd home interest: primary home interest + ((750K - 500K) / 400K) * 2nd home interest.

 

Which one is correct?