Once you've upgraded to Town Hall 12, you can build the Workshop. The Workshop allows you to build Siege Machines. You can donate them to your clan mates that are at least Town Hall 10s or then use them yourself in battle.
You train Siege Machines in the troop training view and store them in the Workshop. Upgrade the Workshop to unlock more Siege Machines!
Donated Siege Machines live in your Clan Castle, and you can only hold one donated Siege Machine at a time.
Siege Machines do not aid in defending your village.
In battle you have to choose between Siege Machines trained by you, or a donated Siege Machine. There is no way to get troops from your Army Camps inside a Siege Machine. The troops donated to your Clan Castle will automatically go into a donated Siege Machine.
The Siege Machine in your Clan Castle does not take up housing space from other troops. Instead, it has a "slot" of its own in your troop capacity.