How can I build a shed in two halves and join them without the roof leaking?
If the two halves of the shed are built to be structurally sound while separate, then there is no reason that each roof can't be built slightly asymmetrically so that one overlaps a portion of the other to provide weatherproof protection, like this:



Some tweaking of the interface would be needed to make it practical and convenient, but the basic idea would be to build it so there is at least 6 inches of overlap where the higher one covers the lower one.