You have to be a little bit more specific in your question (b), since Lie algebra cohomology groups are defined with respect to a module.

Indeed, there is a cohomological criterion for semisimplicity of (real) Lie algebras, which says that a (real) Lie algebra $\mathfrak{g}$ is semisimple if and only if for any finite-dimensional $\mathfrak{g}$-module $\mathfrak{M}$, $H^1(\mathfrak{g},\mathfrak{M})=0$.

This would seem to answer your question (b) if you mean vanishing in this strong sense. If, on the other hand, you mean vanishing of $H^i(\mathfrak{g},\mathbb{R})$ for $i=1,2$, with $\mathbb{R}$ the trivial one-dimensional module, then I am not aware of any very general results. The vanishing of $H^1(\mathfrak{g},\mathbb{R})$ says that $[\mathfrak{g},\mathfrak{g}] = \mathfrak{g}$ and such Lie algebras are called **perfect**. Such algebras cannot be solvable, but there are non-semisimple examples.