Algorithm to determine whether there is an injective homomorphism between two Lie algebras Let $\mathfrak{g}$ be a $n$-dimensional Lie algebra and $\mathfrak{h}$ be a $k$-dimensional Lie algebra ($k < n$). The multiplication tables for these Lie algebras are known. Is there a way to show that $\mathfrak{h}$ is isomorphic to a subalgebra of $\mathfrak{g}$? Or there is no "algorithm"?
To be more specific, I'd like to know the answer to this question if $\mathfrak{g}$ is the 8-dimensional real Lie algebra $\mathfrak{g}$ with multiplication table

and $\mathfrak{h}$ is some 3-dimensional real Lie algebra from the Bianchi classification, e.g. 
$$[E_1,E_2] = E_2, [E_2,E_3] = 0, [E_3,E_1] = -E_3.$$
 A: The new question amounts to classifying, up to isomorphism, 3-dimensional subalgebras of the real Lie algebra $\mathfrak{su}(2,1)$. 
If I'm correct, the answer is:


*

*simple split subalgebras (isomorphic to $\mathfrak{sl}_2$). 

*simple non-split subalgebras (isomorphic to $\mathfrak{so}_3$).

*Heisenberg subalgebras

*subalgebras with basis $(T,X,Y)$ with $[T,X]=X$, $[T,Y]=2Y$, $[X,Y]=0$.


In particular, this discards the Lie algebra with basis $(T,X,Y)$, $[T,X]=X$, $[T,Y]=\lambda Y$, $[X,Y]=0$ whenever $\lambda\notin\{2,\frac12\}$ (the one written as an example by the OP is $\lambda=1$).
To prove this: the first part is to realize each of these algebras. The first two appear as $\mathfrak{su}(1,1)$ and $\mathfrak{su}(2)$. The last two will pop up in the proof.
Consider the action of a 3-dimensional subalgebra $\mathfrak{h}$ on $\mathbf{C}^3$. If it is irreducible, $\mathfrak{h}$ is semisimple and this falls in one of the first two cases. 
So it preserves a line or plane, and preserves its orthogonal too, so preserves a line. If the line is non-isotropic, its orthogonal is a stable supplement, and thus $\mathfrak{h}$ falls into $\mathfrak{s}(\mathfrak{u}(1)\times\mathfrak{u}(2))$ or $\mathfrak{s}(\mathfrak{u}(1)\times\mathfrak{u}(1,1))$, which are 4-dimensional and isomorphic to a product of an abelian 1-dimensional Lie algebra and a simple 3-dimensional Lie algebra. This forces $\mathfrak{h}$ to be simple, and this case is done (of course, if we classify up to conjugation, this is a distinct case! but we don't.)
The last case is when it preserves an isotropic line. In this case let us say that the hermitian form is given by the matrix $\begin{pmatrix} 0 &0&1\\0&1&0\\1&0&0\end{pmatrix}$. Then $\mathfrak{u}(2,1)$ consists of the matrices $$\begin{pmatrix} x&y&it\\z&iu&-\bar{y}\\iv&-\bar{z}&-\bar{x}\end{pmatrix}\quad x,y,z\in\mathbf{C},\;t,u,v\in\mathbf{R},$$
that is, which are skew-hermitian with respect to the antidiagonal; $\mathfrak{u}(2,1)$ consists of those trace zero matrices therein, i.e., for which $iu=-x+\bar{x}$. Since all isotropic vectors are in the same orbit, it is enough to consider the case when $\mathfrak{h}$ preserves the line $(\mathbf{C},0,0)$, that is, is contained in the 5-dimensional subalgebra $\mathfrak{w}$ consisting of those matrices
$$\begin{pmatrix} x&y&it\\0&-x+\bar{x}&-\bar{y}\\0&0&-\bar{x}\end{pmatrix}\quad x,y\in\mathbf{C},\;t\in\mathbf{R}.$$
So we have to classify those 3-dimensional subalgebras of $\mathfrak{w}$ up to isomorphism. Let $\mathfrak{h}$ be solvable and 3-dimensional. We discuss on the dimension $D\in\{0,1,2\}$ of $[\mathfrak{h},\mathfrak{h}]$.
The following facts hold for an arbitrary solvable 3-dimensional Lie algebra over a field of characteristic zero (and certainly also all characteristic except maybe 2,3): 
$D=0$ iff $\mathfrak{h}$ is abelian, $D=1$ iff $\mathfrak{h}$ is Heisenberg or product of a 1-dimensional abelian with the non-abelian 2-dimensional Lie algebra (according to whether the 1-dimensional derived subalgebra is central or not). So we have to discard the abelian case, and to treat the cases when $D=2$.
For the abelian case, observe that for a matrix as above, if $x\neq 0$ it is diagonalizable with distinct eigenvalues; then its centralizer is diagonalizable but is constrained to have trace zero, so has dimension $\le 2$. The for $x=0$ what remains precisely consists of a Heisenberg subalgebra.
Let us discard the non-abelian product case; it has 1-dimensional center. Consider a matrix as above: as in the abelian case, if $x\neq 0$, it has abelian centralizer, which is now excluded. So $x=0$. If $x=0$ and $y\neq 0$, this is conjugate to a Jordan nilpotent matrix and again has abelian centralizer. So the center is the line generated by $E_{13}$. So $\mathfrak{h}$ is contained in the centralizer in $\mathfrak{w}$ of $E_{13}$ which consists of those matrices as above with $x$ purely imaginary, namely those
$$\begin{pmatrix} is&y&it\\0&-2is&-\bar{y}\\0&0&is\end{pmatrix}\quad y\in\mathbf{C},\;t,s\in\mathbf{R}.$$
This 4-dimensional Lie algebra has a basis $T,X,Y,Z$ with $Z$ central and $[T,X]=Y$, $[T,Y]=-X$, $[X,Y]=Z$. It is easy to check that its only 3-dimensional subalgebra is the Heisenberg one with basis $(X,Y,Z)$ (here we use that we work with reals). So this case is excluded.
Finally let us treat the $D=2$ case. Then $[\mathfrak{h},\mathfrak{h}]$ is contained in $[\mathfrak{w},\mathfrak{w}]$ (which is Heisenberg), and is abelian. In a Heisenberg Lie algebra, the 2-dimensional subalgebras consists of those planes containing the center. Hence $[\mathfrak{h},\mathfrak{h}]$ consists, for some nonzero complex number $y_0$, of those
$$\begin{pmatrix} 0&\lambda y_0&it\\0&0&-\lambda\bar{y_0}\\0&0&0\end{pmatrix}\quad t,\lambda\in\mathbf{R}.$$
Then $\mathfrak{h}$ is contained in the normalizer of this 2-dimensional subalgebra in $\mathfrak{w}$, which consists of those matrices as above with $x$ real, namely
$$\begin{pmatrix} x&y&it\\0&0&-\bar{y}\\0&0&-x\end{pmatrix}\quad y\in\mathbf{C},\;x,t\in\mathbf{R}.$$
So $\mathfrak{h}$ has a basis $(T,X,Y)$, with
$$T=\begin{pmatrix} 1&y&it\\0&0&-\bar{y}\\0&0&-1\end{pmatrix},X=\begin{pmatrix} 0&y_0&0\\0&0&-\bar{y_0}\\0&0&0\end{pmatrix},Y=\begin{pmatrix} 0&0&i\\0&0&0\\0&0&0\end{pmatrix},$$
which indeed satisfy $[T,X]=X,[T,Y]=2Y$, $[X,Y]=0$.
A: There are some known, quite explicit, algorithms for the case in which $\mathfrak h$ is abelian. The fact that this case is already quite difficult shows how the problem can be difficult to examine. I suggest reading:
https://homepage.univie.ac.at/Dietrich.Burde/papers/burde_39_max_ab.pdf
and
https://link.springer.com/article/10.1007/s00607-009-0029-8

ADDED after question was edited
Now that you have a specific case of course you can say much much more. Since you have $[\mathfrak g,\mathfrak g]=\mathfrak g$ your real Lie algebra is one of the few 8-dimensional semisimple Lie algebras and yes, you have an algorithm (basically computing the signature of the Killing form) to identify it exactly.
Should it be exactly $\mathfrak{sl}(3;\mathbb R)$(** No it is not: see José's answer) (which is the first obvious guess) then you can find a list of isomorphism classes of its subalgebras, e.g. in P. Winternitz. Subalgebras of Lie algebras. Example of sl(3,R). In P. Winternitz, J. Harnad, C.S. Lam, and J. Patera, editors, Symmetry in Physics. In memory of Robert T. Sharp, volume 34 of CRM Proceedings and Lecture Notes, pages 215–227, Montreal, QC, Canada, 2004. AMS, Providence, R.I.
In general I think you should look for the work of Winternitz, Patera and collaborators which wrote much on this sort of specific examples, usually directly derived from the study of symmetry conditions on specific differential equations.
A: Assuming that the question is whether there exists a Lie algebra monomorphism $\mathfrak{h} \to \mathfrak{g}$, then I am not aware of any algorithm, but with a little "native wit" (to quote one of my esteemed colleagues) one can probably settle this.
One would need to know a little about the structure of the Lie algebras in question.  One way to start to analyse this would be to determine the Levi decompositions of $\mathfrak{h}$ and $\mathfrak{g}$.  There is a Maple package which can help, at least if $n=\dim\mathfrak{g}$ and $k=\dim\mathfrak{h}$ are not too big.  This is part of the Differential Geometry package of Ian Anderson and collaborators.
Edit after the OP included the actual Lie algebras
I suppose that the ground field is $\mathbb{R}$.  The 8-dimensional Lie algebra $\mathfrak{g}$ is semisimple.  It is an easy task to calculate the Killing form $\kappa$ and determine which real form of $\mathfrak{sl}(3,\mathbb{C})$ it is.  I find that
$$
\kappa(e_1,e_7) = - \kappa(e_2,e_6) = 24 \quad \kappa(e_3,e_8) = -6 \quad \kappa(e_4,e_4) = 12 \quad \kappa(e_5,e_5) = -4
$$
which has index 0, so that $\mathfrak{g} \cong \mathfrak{su}(2,1)$.
Upon complexification, there is certainly an embedding of $\mathfrak{h}_{\mathbb{C}}$ into $\mathfrak{g}_{\mathbb{C}}$.  For example, take $E_2 = e_{\alpha}$ and $E_3 = e_{\alpha + \beta}$ and $E_1$ to be a suitable Cartan element in the kernel of $\beta$.  (Here $\alpha$ and $\beta$ are the simple roots of $\mathfrak{sl}(3,\mathbb{C})$.)  However this does not work for the real forms in the question.
