What is the specification need to be followed for SPI
Usually you don't start with "raw" SPI specification. Just look at your MCU datasheet or reference manual and see how its SPI peripheral operates.

The difference in the modes is the clock polarity and phase. Have a look here.

Most microcontrollers support all 4 modes, but the slave devices support only one or two, so the SPI mode is determined by the slave device. 99% of the time mode 0 is used.