Mortgage Interest Deduction with Multiple Mortgages

Hello.  I have two mortgages on two different homes, my primary home and a second home.  The primary home mortgage was originally taken out in 8/2017 ($990K all to purchase the home), and I refinanced it with a cash out in 2021 ($1.08 million, $940K remaining from the original home purchase). The second home mortgage was taken out in 2020 ($663K all to purchase the home).  Can I deduct the mortgage interest from both homes? My concern is the $750K cap that was enacted at the end of 2017.  Does the $750K cap apply to each mortgage separately, or does the $750K cap apply to the combined amount of the mortgages?  Thank you.