Can someone explain the relationship between Spidey, Fantastic Four, and X-Men in the cinematic universe? Why doesn't Marvel own the rights to all three?
Well, back before Marvel was their own studio, they sold the film rights to their franchises. Not thinking far enough ahead, or perhaps not expecting superhero movies to become the booming business they have, these deals typically allowed that the companies in question could maintain the rights so long as they made a new movie every so often. I don't know the explicit terms of any of the deals (you could probably find that info if you really wanted), but that's the basics.
As far as Spider-Man goes, the second Amazing movie bombed and, not wanting to lose the franchise entirely, Sony instead worked out a deal with Marvel. From what I understand, Marvel is basically making the films now and can use Spidey in their team-up movies, but Sony gets a share of the profits. Basically a win-win for both sides since Sony negates much of the risk but still gets a cut of the cash.
The film rights for X-Men and the Fantastic Four are still entirely owned by Fox. However, given that Fox has failed on three different occasions to make a successful Fantastic Four movie, I'd say it's likely that they either just let the license expire or work with Marvel to sell back the rights or make a deal like the Sony one.
X-Men might be trickier since, to this point, that franchise has been wildly successful. Apocalypse reviews have been lukewarm thus far, though, so maybe that changes. It's tough to say. The only thing that might really deter Fox at this point is a box office failure. Otherwise, why give up those rights when they can make a movie every two years that is guaranteed to turn a profit?
To that end, though, it's less obnoxious because at least Fox has mostly done right by the X-Men. You can't complain too much when the casting has generally been excellent and the movies, first Wolverine spin-off and X3 aside, have been enjoyable. Still, it would be awesome to see Magneto as a villain in the Marvel movie-verse.
I just hope they dont recast them.
They absolutely will. No chance they go back in with that same cast after that movie tanked as bad as it did. They want to distance themselves from that train wreck.