I'm international PhD student and I may get terminated soon. Advice urgently needed
How many chances to take a qualifying exam are extended to you depends on how much support you have in the faculty - how much they, or at least someone, believe(s) in you. I’ve seen people being counseled out after one failure, and others passing in their third try. Even if it’s nerve-wrecking, you should treat every exam as if it might be your last chance.
As to “mastering out,” if you went through the entire coursework and were given at least a second chance, they quite possibly would offer you to leave with an M.Sc. anyway, if it comes to that.
Finally, as to changing fields, that depends on how much work you have put in in the field you might be thinking about, and if you have connections in a different department. You could also switch advisers, but from what you write here, your adviser sounds supportive and not the source of your problems.
You’d probably have to leave the country if you’re here on an F1, but for now I’d focus on passing the field exam coming up.