There's no set procedure for switching residency programs. It helps to have your program director involved. You can also use the AAMC's FindAResident to locate open positions: http://www.aamc.org/students/findaresident/
As for credit, it depends; probably 6-12 months. You'll likely have to do at least 2 years of an FM residency.
as stated above, it'll be program specific (on both sides). despite having done two eyars fo residency, you've done NO ob, NO peds, NO surgery and as senior resident, you'd have to supervise/do these procedures/patients. my guess is that you'd get the equivalent of 1 yr of credit for hte ward/ICU/outpatient adult experiences you've had. you'll probably have 2 years of fam med residency to fulfill.
good luck, and congrats for seeing the light! lol....