Oh for gosh sakes, call off the Pied Piper already! You just really just want:
It must be him you enjoy doing your assignments with, not me.
Anything else is overkill in varying degrees. If you’re just dying to stick a whom in there to pair with your him, put it here:
It must be him whom you most enjoy working with, not me.
But even with that one it’s getting awfully stuff in here, and as for the pied-piping you proposed, all those funny with-businesses are very unnatural.
As for “correct”, I don’t know what that means. Certainly you can find people who will say anything, and both those ugly forms can probably be dug out of a large enough set of specimina. But I’ve told you what I would say, and what I think you should say, too.
As for the rest, remember that in English, the pronoun’s objective case is normally the default case, even when copulae are involved, and sometimes other places, too.
“Correctness” you’ll have to ask a kindergarten teacher, who is more likely to be interested in that sort of normative language instruction.