Board certification nowadays requires a residency in the field you are trying to get certified in. So if you want to be boarded in family medicine, you need to do a family medicine residency.
Now, you will meet older DOs and MDs who are triple and sometimes quadruple boarded. There is a tendency to look at these people and go, "Wow, they must be really smart." Well, maybe this is the case... but most likely, they have so many board certifications because they came into the profession at the right time. There was a window of time a few years ago when board cetrification became "the new thing" and so current physicians practicing at the time could sit for an exam and be grandfathered in. As a result, some docs sat for everything and got board certifications out the wazoo. That window is closed, though, and now board certification requires residencies or fellowships.