The intend of the borrower when he/she's acquiring the money from the lender will usually be written at the mortgage servicing disclosure statement.
On top of the intend, both lender and borrower usually also specify the terms that applied to both borrower and lender in case of conflict resolution within the mortgage servicing disclosure statement.