@manorizz this was my "mini pc" set up that has 128gb ram before i rebuilt it into a server in my garage. I can only go down as low as itx.
The only consumer ITX motherboard that takes 4 slots of so-dimm (laptop) ram that i know of at the time (2 years ago) is Asrock X299e-itx and i have 32gb ddr-2666 on each slot making total of 128gb. It comes in two types, server and consumer. Currently both are expensive. Consumer version comes with 3 m.2 slots so that'll be more "mini". Supports 9th and 10th gen i9 extreme processors. For mine i use a i9-9980xe.
The challenge is cooling this sucker as its a 165w cpu. Dynatron has a few 1u coolers for low profiles and even a 1u water cooler. I use a dynatron r15 air cooler. With a fan on top. It was hot and loud most of the time. But it did not throttle.
The cpus for this board do not have integrated graphics. So you need a graphics card. And there are no displayport over type c connectors. So that'll add to your "size". In theory you have two options to avoid this, one is to use displaylink adapter. You'll need graphics card to do initial set up, but once you have it set up... And you are sure you dont need to mess with BIOS in the foreseable future, use a usb to hdmi display link adapter. It'll cost your cpu a small bit to do the video out but worth while for size imo. The other option is to make this computer remote only, not tje best option.
For computer case, i had a dan A4 case, which is smaller than most desktop builds but if you really want to go mini, look into j-hack pure for case and hdplex for power. J-hack pure also have their own kit with mean well power supply too which is more compact than hdplex. This will make this computer be powered without a brick power cable as the brick is inside.
I believe asrock came out with another itx with 4 slots of ram and is AM4 mentioned earlier in the thread... it is called ASROCK X570D4I-2T. And it comes with a VGA output so no graphics card or workaround needed. And AM4 have a wider array of CPUs to choose from.
Alternatively, there are a sleuth of AMD EPYC itx with 4 slot rams from supermicro and asrock that are geared towards server use. But many of these are SoC so you can't choose cpu, and are normally clocked lower.