What's involved in an electrical inspection to obtain a Certificate of Occupancy?
As others have said, what is involved depends on the jurisdiction.

Many homes were built before there were building or electrical codes. Many never got a certificate of occupancy. Most buyers (and their banks and insurers) now require a C of O or its equivalent before a sale.

However, most jurisdictions recognize that it is generally not practical or necessary for older houses to come up to all current standards to be considered safe and occupancy worthy. Some jurisdictions offer a certificate of existing use in lieu of a certificate of occupancy.  This acknowledges that the building predates current C of O rules, but does indicate that basic requirements are met.

Exactly what will be required is jurisdiction specific. I just went through this process for a house being sold in a suburban community in New York. The house was built in 1905. While the house originally had knob and tube wiring, it had all been converted to either armored cable or non-metallic cable over the years. 

The electrical inspection focused on


no exposed wires (finished spaces)
no dangling or unconnected wires (unfinished spaces)
no open junction boxes
no uncovered outlet boxes
adequate grounding of the main panel box (usually to water pipes or ground rods)
circuit breakers (no glass fuses)
presence of smoke and CO (carbon monoxide) detectors


In some jurisdictions, even old knob and tube may be allowed on existing circuits if it is undisturbed, appears sound, and as not been added to.

A common approach taken by inspectors is Does the work conform to code/standards of the period in which it was done?

Note that this type of review, often called a visual inspection, is not the same as an underwriters inspection, which involves a much more rigorous examination and has much tougher regulations.

For some items and in some jurisdictions upgrades will be required if the work or condition is considered unsafe, even if it would have been acceptable in a previous era.

Ultimately, you need to check with your local building department for the exact criteria they will follow. In most cases they try to be reasonable and recognize that historic homes are not going to be fully rewired to bring them up to current code every time they are sold.