What class of Lie groups embed in a general linear group? It’s a non trivial fact that every compact Lie groups embeds as a subgroup of SO(n), what larger class of Lie groups can one consider that necessarily embeds in GL(n)?
Possibly locally compact or finitely generated+ some condition. I know residual finite + finitely generated is insufficient.
 A: This is a partial answer that only applies to connected groups.
Every Lie algebra embeds into the lie algebra $\mathfrak{gl}(n)$ for some $n$. This is Ado's theorem. So for every Lie algebra there is at least one Lie group with that Lie algebra embedding into $GL(n)$.
Because of the relation between different connected Lie groups with the same Lie algebra $\mathfrak{g}$ (they are all quotients of their joint universal covering group $\tilde{G}$ by discrete subgroups $S$ of the center $Z$ of $\tilde{G}$) it is a topological matter. The fundamental group of $G := \tilde{G}/S$ is, if I am not crazy, isomorphic to $S$ and is hence enough to single out $G$ from its locally-but-not-necessarily-globaly isomorphic brothers and sisters.
Now whether the Lie-algebra embedding of $\mathfrak{g}$ into $\mathfrak{gl}(n)$ globalizes to a Lie group embedding of $G$ into $GL(n)$ depends only on if the fundamental group of $G$ is 'compatible' with the fundamental group of $GL(n)$, but I forgot the precise notion of compatibility here.
A: Here is the answer for finitely generated groups (the proof is rather nontrivial):
Definition. A group $\Gamma$ is said to  have a $p$-congruence structure with the bound $c$ if $\Gamma$ has a descending chain of finite index normal subgroups
$$
\Gamma=N_0\supset N_1 \supset N_2 \supset ...
$$
such that
(1) $\bigcap_i N_i=\{1\}$.
(2) $N_1/N_i$ is a finite $p$-group for each $i>1$;
(3) Each quotient group $N_i/N_j$ ($1\le i<j$) is generated by $c$ elements.
Note that part (1) is equivalent to the residual finiteness of $\Gamma$.
Theorem. Let Γ be a finitely generated group. Then the following conditions are equivalent:
(A) Γ is isomorphic to a subgroup of the group $GL_n({\mathbb C})$ for some $n$.
(B) Γ has a $p$-congruence structure with some bound $c$ for some prime $p$.
See:
Alexander Lubotzky, A group theoretic characterization of linear groups, J. Algebra 113, No. 1, 207-214 (1988). ZBL0647.20045.
