One way is that the officer must submit to periodic physicals. If the officer doesn't want to take the physical, say, becuase they have gained a lot of weight since leaving active duty, the officer will be given the option of either resigning his commission and receiving an honorable discharge, or, failing that and refusing to attend a physical, receive something less than an honorable discharge.
Kerry's leaving active duty in '72 and not being discharged until '78 is probably no big deal.
One way is that the officer must submit to periodic physicals. If the officer doesn't want to take the physical, say, because LOL! You don't mean to say Kerry might have missed a physical??? Well, there, even Kerry's team would have to admit that's totally disqualifying for the presidency!