Generally, if you are on the note for the house, you are not just going to be able to sign a document and automatically be released from that liability. Even if the court awards the house to your wife in the divorce, you are still on the hook as it's up to the bank/creditor to make the decision to release you from liability.
You should try to get your wife to refinance the home in her name only. If she can qualify to do so, that will effectively remove you from any liability on the home. If she can't qualify to refinance the home, then you need to put some protective language in the divorce decree . Also, you need to have her sign a Deed of Trust to Secure Assumption. This document will force the bank to give you notice of an delinquent balance on the house after you are divorced. The bank has to give you the chance to cure the default (pay the amount owed), before they can initiate a foreclosure.
These situations are always tricky - there may be other options, but without all the facts I can't get more specific. I advise you to speak with an attorney - this is a complex area to deal with. Best of luck.
I agree with Mr. Stewart. He is exactly right on all counts, including saying that this is a tricky area. You absolutely must have an attorney to help you through this. If your wife has any cash in the bank, you can probably get the court to order her to pay your attorney's fees.
Sign up to receive a 10-part series of useful information and legal advice about the divorce process.