You can change the way vanilla DiredMode sorts files either by:
‘s’to toggle between alphabetical and date order and with prefix argument, edit listing switches
For a list of listing options, see ls manual.
You can accomplish this by customizing variable
‘dired-listing-switches’ to include
‘--group-directories-first’. For example:
(setq dired-listing-switches "-aBhl --group-directories-first")
See DiredSortDirectoriesFirst for other solutions.