In California, and several other of the anti-deficiency states, Purchase money loans have special protections. If a foreclosure occurs, the lender cannot pursue the homeowner for the deficiency. Since 1st lenders universally foreclose by trustee sale, they cannot pursue a deficiency anyway, so this protection comes into play in dealing with the second. For the second to be purchase money, these four requirements must be met:
1) The loan must be secured on the property purchased 2) The money from the second must have been use to purchase the property 3) The property must be 1 to 4 units 4) The property must be the personal residence of the borrower and the borrower must be residing in the property.
If you have refinanced the second with the SAME lender, then the purchase money character of the loan stays with the new loan, at least as to the amount of the purchase money second being refinanced. Additional funds pulled out of the property as part of the refinance will not have purchase money protection.