https://stackoverflow.com/questions/22367457/maximum-number-of-primary-partitionsThis is not a Linux restriction, it's a restriction of the MBR partition layout. The original MBR spec fit the partition layout into a single 512 byte sector, and there was only room to define four "primary" partitions there. Various nonstandard extensions exist allowing more than four partitions in MBR, but the classical spec only allotted for four.
"Extended boot records" are a fairly common way of extending MBR past its first four primary partitions. One partition entry in the MBR partition table is actually a pointer to another partition table. This second partition table can have a pointer into a third, etc etc, giving, in principle, an unlimited number of extended partitions. However, since these extended partitions are not defined inside the main MBR, they are not primary partitions, and you typically cannot boot from them.
Switching to a more modern standard, such as GPT, removes this restriction -- but may not be compatible with some motherboards and operating systems. For example, Windows does not support EFI, the modern spec underlying GPT, unless you are running a 64-bit operating system.