Motherboards are all standard sizes – ATX and microATX are two common sizes for example, with holes to screw the MB to the case in set postions. PC cases can often take a number of different sizes of MB (it will be written on the side of the box along with how many hard drive bays, CD bay etc it has).
Which CPU goes with which MB is simmilar. CPU’s are designed to fit a specific socket depending on whcih company manufactured them and when. Intels newest “sandybridge” CPU’s use a 1155 socket so you need to buy a motherboard with a 1155 socket. Older Intel CPU’s could use an 1156 or 1366 socket so you would need a different motherboard for them. The best way to tell is to check the specifications for the component you’re interested in – it will list the CPU’s compatible as well the type of memory needed etc. You can also look at the manufacturers website for a PDF of the manual which would also have all the info in it.
The easiest way to find out if two components are compatible is to find a local independent stockist and ask them. They will often be more than willing to advice on the best kit to suit your needs and give you tips on how to assemble the computer. For a modest fee they may even assemble the whole thing for you.