You need to use a Compressor for this - there is a Compressor effect buitl in to Audacity: select the audio and use Effect > Compressor.
There is a better compressor available called Chris’ Dynamic Compressor which can be used as an Audacity plug-in. See this thread: Chris Capel's Dynamic Compressor
WC