Family medicine takes care of people of all ages including babies and children, pregnant women, adults, and the elderly.
Internal medicine is limited to the care of adults (including the elderly).
Internists (a person trained in internal medicine) has some training in the diagnosis and treatment of common medical conditions such as allergies, arthritis, hypertension, diabetes, infections, overactive and underactive thyroid, acid reflux and stomach ulcers, depression, some gynecologic issues (including oral contraceptives) and the provision of preventive services such as immunizations, counseling on smoking cessation, and the ordering of screening tests for cancer. The challenge is knowing when to treat and when to refer a patient to a specialist (someone who has done a fellowship and who has more training and experience in a single area of medicine such as cardiology or oncology).
There was a time when most physicians cared for patients in the office (out patient setting, "the doctor's office") and also saw the same patients when they needed hospital care. Things are changing and now more hospital-based care is provided by "hospitalists" who limit their services to the treatment of patients in the hospital (or who need pre-operative medical clearance as out patients) which is more efficient (the doctor doesn't have to run back & forth from the hosptial to the office twice each day and field phone calls from the nurses in the evening and overnight) but it does leave physicians feeling like they lose track of their patient during the hospitalization. On the other hand, patients are not hospitalized as much as they were 30 years ago and there is more care being delivered at home (IV antibiotics, for example, and wound care) that would have been done in the hospital a generation ago.
An internist usually cares for patients on a "medicine" floor or in the Intensive Care Unit (although that care is usually delivered by a specialist in Critical Care Medicine). Some of the common reasons for being admitted to a medicine floor might include pneumonia, liver failure, serious infections, heart failure, heart attack (after acute treatment is finished). In places where family medicine docs are common (no where I've ever lived) the Family Medicine physicians might take care of adults with the same ailments that internists see in the hospital. I doubt Family Medicine docs treat many hospitalized kids as anything bad enough to send a kid to the hospital overnight is likely to be handled by a pediatric subspecialist.
Understanding how all this works is one good reason to shadow physicians in a few different areas of medicine before starting medical school and then getting additional exposure during the first 3 years of medical school at which point one makes a decision about residency training.