Intel socket LGA1151 CPUs have an embedded memory controller, meaning that it is the processor, not the chipset, that defines what memory technologies you can have and the maximum amount of memory that is possible. The motherboard, however, may have a limitation as to how much memory can be installed.
These CPUs are compatible with both DDR3L (up to 1,600 MHz) and DDR4 (up to 2,133 MHz) memory. So, it is the motherboard that defines which memory type (DDR3 or DDR4) can be installed, since DDR4 slots are physically different from the DDR3 slots. According to Gigabyte, the Z170MX-Gaming 5 supports DDR4 memories up to 3,466 MHz.
The Gigabyte Z170MX-Gaming 5 has four memory sockets. You can install up to 64 GiB with this motherboard if you use four 16 GiB modules.
In order to enable the dual-channel mode, you must install two or four memory modules. On the Gigabyte Z170MX-Gaming 5, the first and third memory sockets are black, while the second and fourth are red. When installing two memory modules, use two sockets with the same color.
Figure 3: memory sockets; install two or four modules for the best performance