Does your cosigner have to be present to refinance a home?

Not if a party has a proper power of attorney (POA) to represent the cosigner. The mortgage company will tell you what form of POA they want, and generally it is included with the paperwork, and the POA will have to be notarized.

I know this from personal experience, I am a Notary Public and back in the early 2000s I was handling mortgage refinancing where the mortgage company pays me to go out to people's houses to watch them sign, what is called a "mobile notary," and when someone else is signing on behalf of a person not present, they will tell the mortgage company and have a power of attorney with whatever wording the mortgagor wants, signed by the cosigner and notarized, authorizing the substitute person to sign on their behalf. That would be included with the paperwork sent back to the mortgage company.

But you have to notify the mortgage company ahead of time and find out what form they want the power of attorney to be; most have their own specific form they want you to use.