taxpayer must track the use of loan proceeds to determine the type of interest paid IRS REG 1.168-8T
The following is a suggestion, not a requirement. you should keep loan proceeds totally separate from other funds whenever possible. This can avoid reallocation by the IRS.
to qualify, per the iRS, must be used to buy, build or substantially improve the property. (IR-2018-32)
As under prior law, the loan must be secured by the taxpayer’s main home or second home (known as a qualified residence), not exceed the cost of the home and meet other requirements.
@alex1260 Why are you asking this? We really need to understand your situation more. For example, if you paid for a substantial improvement to your home out of pocket or with a previously unsecured loan, and then secured a cash out refinanced within a reasonable time after completion, you can trace or reallocate the portion of the cash out equal to the amount you paid in cash or loan principle before completion of the improvement.