The new mortgage would likely be classified as a cash-out refinance on an owner-occupied property (second home) because you are taking cash out of the home to buy-out your friend's ownership interest in the property, and perhaps paying off an existing mortgage on the property and/or keeping some of the proceeds from the loan. From the lender's standpoint, if you get a mortgage on a property that you already own and any portion of the proceeds goes toward anything other than paying down an existing loan on the property, the mortgage is technically considered a cash-out refinance.
The good news is that because the property is a second home as opposed to a rental or investment property, the mortgage should be classified as owner-occupied which means your interest rate should be lower than if the property is classified as non-owner occupied. The bad news is because the loan will likely be classified as a cash-out refinance, your interest rate will be higher than a straight rate and term refinance, when you do not receive proceeds from the loan, regardless of what you use the proceeds for.
Regardless of how the mortgage is classified, your best course of action is to contact at least four lenders (our INTEREST RATES function makes it easy), explain your situation and ask for their best mortgage terms. Ultimately, selecting a lender always comes down to finding the best terms, no matter what type of mortgage. You may find a lender that classifies the mortgage as a cash-out refinance that offers better terms than a lender that classifies the loan as a straight refinance or home purchase mortgage.