How does the IRS determine whether "cash out" has been taken from a loan?

We had a main mortgage loan for the house, and a second mortgage as well. None of the money from the second mortgage was used for home improvements.

In 2020 we refinanced and rolled both loans into the refinance loan so that we now have a single loan for the house. I've followed the steps for entering multiple 1098s (there were 3 of them), and now TurboTax is asking me whether I ever took any cash out of the refinance loan.

Since the money from 2nd mortgage loan (which was rolled into the refinance loan) was not used for home improvements, is the amount of the refinance loan used to pay for the 2nd mortgage loan considered as cash out? For example, if my second mortgage loan was for $27,000.00, does the IRS view that amount as cash taken out of the total refinance in order to pay for the 2nd mortgage that was rolled into the refinance loan?