SOHC means that there is only one camshaft per header. Inline engines will contain one camshaft. V-type and/or flat will contain 2 camshafts. For a SOHC engine there are usually 2 valves per cylinder but there can be more with the addition of cams for each valve.
DOHC have2 camshafts per header. So in an inline there are 2 camshafts because there is only one header, but there is 4 in a V-type or flat engine. These DOHC engines usually have 4 valves. One camshaft for the exhaust valves and the other for the intake valves.
Advantages to having a DOHC engine over a SOHC is that the engine has twice as many intake and exhaust valves as a SOHC motor. This makes the engine run cooler and more smoothly, quietly, and efficiently. But the downfall is that DOHC engines cost more for repairs.