It has been suggested that dust storms efficiently transport water vapor from the near-surface to the middle atmosphere on Mars. Knowledge of the water vapor vertical profile during dust storms is important to understand water escape. During Martian Year 34, two dust storms occurred on Mars: a global dust storm (June to mid-September 2018) and a regional storm (January 2019). Here we present water vapor vertical profiles in the periods of the two dust storms (Ls = 162-260° and Ls = 298-345°) from the solar occultation measurements by Nadir and Occultation for Mars Discovery (NOMAD) onboard ExoMars Trace Gas Orbiter (TGO). We show a significant increase of water vapor abundance in the middle atmosphere (40-100 km) during the global dust storm. The water enhancement rapidly occurs following the onset of the storm (Ls~190°) and has a peak at the most active period (Ls~200°). Water vapor reaches very high altitudes (up to 100 km) with a volume mixing ratio of ~50 ppm. The water vapor abundance in the middle atmosphere shows high values consistently at 60°S-60°N at the growth phase of the dust storm (Ls = 195°-220°), and peaks at latitudes greater than 60°S at the decay phase (Ls = 220°-260°). This is explained by the seasonal change of meridional circulation: from equinoctial Hadley circulation (two cells) to the solstitial one (a single pole-to-pole cell). We also find a conspicuous increase of water vapor density in the middle atmosphere at the period of the regional dust storm (Ls = 322-327°), in particular at latitudes greater than 60°S.