A stand alone, counter top microwave oven does not need to be vented.
An over the stove wall mounted type that usually comes with an exhaust fan on its bottom is best vented to outdoors for removal of smoke and odors (not from the microwave process but from the stove process). It's 2 appliances in one. When it is not possible, there are built in but removable filters in the exhaust fan that will work to some degree but not nearly as well as venting to outdoors. Code will not require outdoor venting. When remodeling, easiest to place stove and vent on an exterior wall. Alternate designs with elbows inside walls and/or to roof collect more grease.