The classification of real forms of semisimple Lie algebras was accomplished by Élie Cartan in the context of Riemannian symmetric spaces.
This is a number between 0 and the dimension of g which is an important invariant of the real Lie algebra, called its index.
Élie Cartan proved that every complex semisimple Lie algebra g has a split real form, which is unique up to isomorphism.
A real Lie algebra g0 is called compact if the Killing form is negative definite, i.e. the index of g0 is zero.
In general, the construction of the compact real form uses structure theory of semisimple Lie algebras.