It depends on the situation. But these are the rules:
-Intern year doesn’t count because you don’t have a medical license at this point. You start paying back USUHS time once intern year is completed (because at this point, if the military needs to pull you out of residency to be a doctor in ww3, they can since you are a licensed physician).
however, post-internship residency also incurs a payback obligation. So while you are paying back USUHS time during post-internship residency years, you are also incuring time. This isn’t super important if you complete everything straight through, because at the end of the day you will owe 7 years after residency ends. (Spend 3 years in post-internship residency paying back 3 years of USUHS obligation but gain 3 years, so you still owe 7 after residency).
this technicality matters though if you get pulled to do a flight surgery/UMO tour if you are navy. You will pay back 3 USUHS years as a flight surgeon, then pay back 3 more USUHS years when you go back to your post-internship residency. You gain 3 years obligation from residency training, plus your 1 leftover USUHS year obligation, so you will owe 4 years as an attending when finishing in this scenario.
bottom line, you essentially owe 7 years in an operational/deployable status.