In the US, a sedan usually has a boot/trunk. the Model S is classified as a sedan though it would normally be called a hatchback. All the definitions are a bit vague, but here is how they are usually used:
If the back window is stationary and there is a boot/trunk, it's usually called a sedan.
If the car has a profile similar to a sedan, but the back window opens with the boot/trunk, it's a hatchback. Though the term has fallen out of favor and is rarely used to refer to new cars, even when they have features almost identical to old cars called hatchbacks.
If the car is squared off in back and the back window opens to access the rear cargo area, it's called quite a few different things though traditionally they were called wagons or station wagons. That definition has been muddied by various truck chassis vehicles called SUVs and now CUVs, and probably a bunch of other terms. "Wagon" has largely fallen out of favor as a term for new cars, but some niche cars have used the term for years, for example Subaru has called the Outback a "sport utility wagon" for many years.
A hatchback might be a bit wagon-like, but it isn't squared off like a wagon and/or doesn't have the long cargo area of a wagon. A Mini-Cooper would have usually be defined as a hatchback because the cargo area is small.
These are all terms that have evolved over time and there are probably Americans who wouldn't agree with my definitions.
I am one of those, LOL. Though I would agree that the terms are vague.
In older days there was less variety so it was less muddled. It usually went like this:
Coupe: 2 side doors and a trunk in the rear.
Hatchback: 2 side doors and a full-height rear area, with a rear hatch.
Sedan: 4 side doors and a trunk in the rear.
Station wagon: 4 side doors and a full-height rear area, with a rear door or hatch.
Fastback: a modifier for coupe or sedan - usually 2 doors, but can have 4 doors, with a sloping back yielding more area than a trunk but not full-height like a hatchback or wagon. The rear opening can be hatch-like or trunk-like.
Sport utility vehicle (SUV): truck-based vehicle but with seating and internal cargo area instead of an open bed.
Over time, the rear of most hatchbacks and wagons have gotten more and more sloped, though the roofline still usually extends some distance further back than a coupe or sedan before dropping downward. The 4-doors now tend to be called 'crossovers' instead of wagons, though the smaller 4-doors can be called hatchbacks (Toyota Matrix for instance). There is a stigma on the word 'wagon' so IMO the carmakers are using the slopey rear styling as an excuse to call most wagons 'crossovers'. They are now almost always too slopey to use a door in the back, so a rear hatch is the norm.
SUVs and wagons have basically been converging upon a size point in between, leading to the CUV (crossover utility vehicle), which unlike wagons and crossovers are generally taller than sedans, but don't have a profile as truck-like and 'upright-looking' as an SUV. Carmakers seem to waffle on what term they use depending on their target market. I'd expect a CUV almost certain to be car-based and an SUV more likely to be truck-based, but these days even most SUVs don't have much truck DNA.
Using these criteria I would call the Model S a fastback sedan, and the Model X a CUV or small SUV. (CUV is still in the process of gaining traction I think.) I have no strong opinion on whether the Model 3 will be a standard sedan or a fastback sedan. A standard sedan might be a little more likely since they will have the crossover version for people who want a rear hatch. I personally would prefer a crossover/wagon version, but not so much that I'm willing to wait 6 months or more after the sedan's release. If it's going to be that long I'll settle for the sedan.