First and second order vibrations are both helped by making the reciprocating parts as light as possible to minimize the magnitude of the vibration. But beyond that ...
To address 1st-order vibrations:
Cylinder configuration versus crank weights versus balance shafts versus engine mounts. A single needs two balance shafts, one on each side, spinning opposite direction of the crank, with both the crank and balance shaft weights correctly selected to offset the piston and con-rod. A lot of production singles make do with one balance shaft and just deal with the resulting rocking couple (my Honda motorcycle is like that). A lot of others just let 'er shake (practically every lawn mower, etc). A parallel 360-degree twin is the same as a single for purposes of vibration. A 90-degree V-twin with the correct crank counterweights has perfect primary balance. An inline triple has perfect primary up-and-down balance but they have a first-order rocking-couple imbalance that needs a counter-rotating balance shaft to offset. Triumph 3-cylinder motorcycle engines use balance shafts. Many automotive 3-cylinders have no balance shafts and they just let the engine mounts (more or less) deal with it. And so on ...
Balance your pistons and rods. Every up-and-down pair of pistons ought to have as close to the same weight as possible. Same with the con-rods, and both the small-end and big-end matter and should be balanced separately. The crank counterweights have to be correct for the pistons and rods. And so on ...
For 2nd-order vibrations:
Triples and inline-sixes have little second-order vibration. Take a look at the crankshaft in a normal (American) V8 engine. It isn't flat like an inline-four crankshaft. In each bank for each two pistons that are up-and-down there are two that are mid-travel. Reason: better second-order balance, and remember that since a 90-degree V-twin with the right crank weights has perfect primary balance on its own, stacking 4 of them end-to-end still has perfect primary balance (and you can cancel out some of the counterweights by doing this). For an inline-four ... Two counter-rotating balance shafts running twice crank speed. Or, use long rods relative to the stroke (it minimizes the origin of the second-order vibration).
The original poster would do well to study the design of the 2009-onwards Yamaha R1 1000cc inline-four - the one with the "crossplane" crankshaft - and understand why this uneven-firing engine runs smoother at high revs than its traditional even-firing competitors.