The shell variable HISTCONTROL controls what goes into the command history of bash shell. If HISTCONTROL variable equals to "ignorespace", that means commands starting with a space are not saved in history.
$ HISTCONTROL ignorespace
$ echo $HISTCONTROL
ignorespace
$ date
Fri Oct 21 14:20:36 +03 2022
$ uname
Linux
$ history
2007 HISTCONTROL="ignorespace"
2008 echo $HISTCONTROL
2009 date
2010 history
#Because of the space before uname command, it does not appear in
command history.