Fox completely own the rights to X-Men and Fantastic 4, and won't let Marvel/Disney have anything to do with them as they're worth too much money to Fox. Marvel can't even use the word 'mutant'. Hence the massive push to make the Inhumans mainstream.
Sony own rights to Spider-Man and his related characters, but thanks to a deal struck last year Marvel are free to use Spider-Man in the MCU, and he'll make his first appearance in Civil War in May. Conversely, Marvel will have heavy input in the new Spider-Man movie that Sony are making