Since I recently did some digging on this, i can give a quick answer:
1) CMCs appear based on a random number generated every production cycle, from 1 to 1,000,000. If that number is less than the civ's annual income, a CMC is created. The systems with pop 10M+ are ranked in decending order, so most populated system has first chance. It's a 50% chance that the CMC will be in most populated system; If it isn't, it's 50% for second most; that fails, 50% for third most, etc.
2) CMCs are placed on surveyed system bodies within 80AU of the system primary. Minimum minerals for a CMC to be emplaced are a supply of either Sorium or Duranium of 15,000 and 0.7 accessibility, but 25,000/0.8 are checked first.