I'm assuming that when you say the couple were "sharing mortgage payments" that both people are on the mortgage and are co-owners of the property. If that is the case, the only way both of you can make sure that your credit is not affected is to make sure that the mortgage is paid on time. As far as the mortgage company is concerned, you are both responsible (jointly and individually) for making sure the mortgage is paid.
Usually, you need to get the mortgage company's permission to take one person off the mortgage. If you try to transfer the property from both of you to just one of you without the mortgage company's ok, you will probably be in default. Check your mortgage papers to be sure, but this is a provision in most standard mortgages.
If only one of you is on the mortgage and owns the property (presumably the person who is staying), then there should be no effect on the credit of the person who leaves & stops contributing to the monthly mortgage payment.