Early creatures had mady different body plans. We have 4 (all vertebrates), 6 (insects), 8 (arachnids) and multilegged creatures (millipedes), as well as legless creatures like snakes (who had 4 legs before they lost them).
It seems that vertebrates have certain period when this layout was 'cast in stone' [1]
[1]: https://biology.stackexchange.com/posts/21793/revisions