Nearby extended protoplanetary disks are commonly marked by prominent rings in dust emission, possibly carved by forming planets. High-resolution observations show that both the dust and the gas are structured. These molecular structures may be related to radial and azimuthal density variations in the disk and/or the disk chemistry. The aim of this work is to identify the expected location and intensity of rings seen in molecular line emission in gapped disks while exploring a range of physical conditions across the gap. In particular, we aim to model the molecular rings that are, in contrast with most other gapped disks, co-spatial with the dust rings at sim 20 and sim 200 au in the HD 100546 disk using the thermochemical code DALI. We modelled observations with the Atacama Large Millimeter/submillimeter Array (ALMA) of CO isotopologues C I HCN, CN C2H NO, and HCO+ in the HD 100546 disk. An axisymmetric 3D thermochemical model reproducing the radial profiles of the CO isotopologue observations and the double ring seen in continuum emission was used to make predictions for various emission lines. The effect of the amount of gas in the dust gap, the C/O ratio, an attenuated background UV radiation field, and the flaring index on the radial distribution of different molecules were investigated. The fiducial model of a gapped disk with a gas cavity at $0-15$ au, a dust cavity at $0-20$ au, and a gas and dust gap at $40-175$ au provides a good fit to the continuum and the CO isotopologues in the HD 100546 disk. In particular, the CO isotopologue emission is consistent with a shallow gas gap with no more than a factor of approximately ten drop in gas density at $40-175$ au. Similar to the CO isotopologues, the HCN and HCO+ model predictions reproduce the data within a factor of a few in most disk regions. However, the predictions for the other atom and molecules C I CN C2H and NO, neither match the intensity nor the morphology of the observations. An exploration of the parameter space shows that, in general, the molecular emission rings are only co-spatial with the dust rings if the gas gap between the dust rings is depleted by at least four orders of magnitude in gas or if the C/O ratio of the gas varies as a function of radius. For shallower gaps the decrease in the UV field roughly balances the effect of a higher gas density for UV tracers such as CN C2H and NO. Therefore, the CN C2H and NO radicals are not good tracers of the gas gap depth. In the outer regions of the disk around 300 au, these UV tracers are also sensitive to the background UV field incident on the disk. Reducing the background UV field by a factor of ten removes the extended emission and outer ring seen in CN and C2H respectively, and reduces the ring seen in NO at 300 au. The C/O ratio primarily effects the intensity of the lines without changing the morphology much. The C I HCN, CN, and C2H emission all increase with increasing C/O, whereas the NO emission shows a more complex dependence on the C/O ratio depending on the disk radius. CO isotopologues and HCO+ emission trace gas gaps and gas gap depths in disks. The molecular rings in HCN, CN C2H and NO predicted by thermochemical models do not naturally coincide with those seen in the dust, contrary to what is observed in the HD 100546 disk. This could be indicative of a radially varying C/O ratio in the HD 100546 disk with a C/O above one in a narrow region across the dust rings, together with a shallow gas gap that is depleted by a factor of approximately ten in gas, and a reduced background UV field. The increase in the C/O ratio to approximately greater than one could point to the destruction of some of the CO, the liberation of carbon from ice and grains, or, in the case of the outer ring, it could point to second generation gas originating from the icy dust grains.