An over-range microwave needs to be a minimum of 13 inches between the range and microwave and at least 66 inches above the floor. The minimum distance between the stove top and the bottom of the overhead cabinet is 30 inches.
Over the counter microwaves are safe for both gas and electric stoves as long as the installer maintains the minimum floor to cabinet clearance and the stove. In general, ranges or cook tops with up to five burners are safe for use with these units. Failing to observe these clearances creates safety issues and invalidates the manufacturer's warranty for the customer.