As it was a purchase money security interest you have no liability for any deficiency. They may try to collect but they will not succeed. The charge off stays on your credit file for 7 years, but that is the only negative. If you default on first you also have no liability.
The response given is not intended to create, nor does it create an ongoing duty to respond to questions. The response does not form an attorney-client relationship, nor is it intended to be anything other than the educated opinion of the author. It should not be relied upon as legal advice. The response given is based upon the limited facts provided by the person asking the question. To the extent additional or different facts exist, the response might possibly change. Attorney is licensed to practice law only in the State of California. Responses are based solely on California law unless stated otherwise.
Section 580b of the Cal. Code of Civil Procedure states that any purchase money mortgage (the funds to buy your property, initially, but it can also include improvements) cannot get a deficiency judgment against you on a dwelling for four families or less in which you occupied the premises. That does not mean that they will not sue you, but you can assert this among your defenses and use this to dispute a balance claimed on your credit reports. A mortgage is secured until the foreclosure, then any balance is unsecured, but it may be $0, if subject to Sections 580b or 580d.
Your next question is how long they may try to collect. If they are not allowed a deficiency, then they should not sue you in court, and they cannot call you about a balance, because you have no balance. If they are allowed a deficiency, they can try collection calls forever or try to sue you for up to four years from date of default or date of your last payment, whichever is later. Once the four years expires, they still have a right to call you and ask you to pay, but they cannot threaten to sue you, because the statute of limitations makes a lawsuit illegal.
Your last question is about your credit report. How long? Seven years from the date of your default on the loan. If the account is considered a "collection account" such as placed with a debt collection agency, that adds 180 days, for a total of 7.5 years on your report from date of default.
If this shows up on your credit report as a large balance, you can dispute it if you believe that it is not proper and no deficiency balance may be allowed. I am not sure if that will get it off your credit, but it is worth a try. See letter #3.1 on my web site in the first link, below. The older the debt gets, the less effect it has on your credit scores, so your scores will eventually be restored. The second link is to my web site in case you are sued, how to stop that lawsuit.