When it is usually using a bigger algebra system to formulate the Maxwell equations, in this paper we consider a real four-dimensional algebra to express the Maxwell equations without appealing to the imaginary number and higher dimensional algebras. In terms of g-based Jordan algebra formulation the Lorentz gauge condition is found to be a necessary and sufficient condition to render the second pair of Maxwell equations, while the first pair of Maxwell equations is proved to be an intrinsic algebraic property. Then, we transform the g-based Jordan algebra to a Lie algebra of the dilation proper orthochronous Lorentz group, which gives us an incentive to consider a linear matrix operator of the Lie type, rendering more easy to derive the Maxwell equations and the wave equations. The new formulations fully match the requirements for the classical electrodynamic equations and the Lorentz gauge condition. The mathematical advantage of our formulations is that they are irreducible in the sense that, when compared to the formulations which using other bigger algebras (e.g., biquaternions and Clifford algebras), the number of explicit components and operations is minimal. From this aspect, the g-based Jordan algebra and Lie algebra are the most suitable algebraic systems to implement the Maxwell equations into a more compact form.