[proofplan]
We enumerate the countable model $M$ and build, by induction, finite partial elementary maps into an arbitrary model $N \models T$. Atomicity supplies an isolating formula for each finite tuple from $M$. The key extension step is that an isolating formula for the already-mapped prefix transfers the existential assertion needed to realize the next isolated type in $N$. The union of the finite maps then preserves every formula on every finite tuple, hence is an elementary embedding $M \to N$.
[/proofplan]
[step:Enumerate the model and fix the target model]
Let $N \models T$ be arbitrary. Since $M$ is countable, choose an enumeration
\begin{align*}
M = \{a_k : k \in \mathbb{N}\}
\end{align*}
without repetitions.
For each $k \in \mathbb{N}$, define the finite tuple
\begin{align*}
\bar{a}_k := (a_1,\dots,a_k) \in M^k.
\end{align*}
Because $M$ is atomic, the complete type $\operatorname{tp}^M(\bar{a}_k/\varnothing)$ is isolated. Hence for each $k \in \mathbb{N}$ choose an $\mathcal{L}$-formula
\begin{align*}
\theta_k(x_1,\dots,x_k)
\end{align*}
which isolates $\operatorname{tp}^M(\bar{a}_k/\varnothing)$, meaning that $M \models \theta_k(\bar{a}_k)$ and, for every $\mathcal{L}$-formula $\psi(x_1,\dots,x_k)$,
\begin{align*}
M \models \psi(\bar{a}_k)
\quad\Longleftrightarrow\quad
T \models \forall x_1\dots \forall x_k\bigl(\theta_k(x_1,\dots,x_k) \to \psi(x_1,\dots,x_k)\bigr).
\end{align*}
[/step]
[step:Build finite tuples in $N$ realizing the corresponding isolated types]
We construct, by induction on $k \in \mathbb{N}$, tuples
\begin{align*}
\bar{b}_k := (b_1,\dots,b_k) \in N^k
\end{align*}
such that
\begin{align*}
N \models \theta_k(\bar{b}_k).
\end{align*}
For $k = 1$, since $M \models \exists x_1\,\theta_1(x_1)$ and $M \models T$, completeness of $T$ gives
\begin{align*}
T \models \exists x_1\,\theta_1(x_1).
\end{align*}
As $N \models T$, choose $b_1 \in N$ such that $N \models \theta_1(b_1)$.
Assume now that $k \in \mathbb{N}$ and that $\bar{b}_k \in N^k$ has been chosen with $N \models \theta_k(\bar{b}_k)$. Define the $\mathcal{L}$-formula
\begin{align*}
\exists x_{k+1}\,\theta_{k+1}(x_1,\dots,x_k,x_{k+1})
\end{align*}
in the free variables $x_1,\dots,x_k$. Since $M \models \theta_{k+1}(\bar{a}_{k+1})$, we have
\begin{align*}
M \models \exists x_{k+1}\,\theta_{k+1}(\bar{a}_k,x_{k+1}).
\end{align*}
Because $\theta_k$ isolates $\operatorname{tp}^M(\bar{a}_k/\varnothing)$, it follows that
\begin{align*}
T \models \forall x_1\dots \forall x_k
\left(
\theta_k(x_1,\dots,x_k)
\to
\exists x_{k+1}\,\theta_{k+1}(x_1,\dots,x_k,x_{k+1})
\right).
\end{align*}
Since $N \models T$ and $N \models \theta_k(\bar{b}_k)$, there exists $b_{k+1} \in N$ such that
\begin{align*}
N \models \theta_{k+1}(\bar{b}_k,b_{k+1}).
\end{align*}
This completes the induction.
[guided]
The purpose of the induction is to choose images for the elements of $M$ one at a time, while ensuring that every finite initial tuple has exactly the same complete type in $N$ as the corresponding tuple in $M$.
For the first element, atomicity gives an isolating formula $\theta_1(x_1)$ for $\operatorname{tp}^M(a_1/\varnothing)$. Since $M \models \theta_1(a_1)$, the sentence $\exists x_1\,\theta_1(x_1)$ is true in $M$. Because $T$ is complete and $M \models T$, every sentence true in $M$ is a consequence of $T$. Thus
\begin{align*}
T \models \exists x_1\,\theta_1(x_1).
\end{align*}
Since $N \models T$, there is $b_1 \in N$ with
\begin{align*}
N \models \theta_1(b_1).
\end{align*}
Now suppose we have already chosen $\bar{b}_k = (b_1,\dots,b_k) \in N^k$ such that
\begin{align*}
N \models \theta_k(\bar{b}_k).
\end{align*}
We need to choose $b_{k+1}$ so that the longer tuple realizes the isolated type of $(a_1,\dots,a_k,a_{k+1})$. The formula $\theta_{k+1}(x_1,\dots,x_k,x_{k+1})$ isolates that longer type, and $M$ realizes it at $\bar{a}_{k+1}$. Therefore
\begin{align*}
M \models \exists x_{k+1}\,\theta_{k+1}(\bar{a}_k,x_{k+1}).
\end{align*}
The important point is that this existential statement depends only on the complete type of the prefix $\bar{a}_k$. Since $\theta_k$ isolates $\operatorname{tp}^M(\bar{a}_k/\varnothing)$, every formula true of $\bar{a}_k$ is forced by $T$ together with $\theta_k$. Applying this to the formula
\begin{align*}
\exists x_{k+1}\,\theta_{k+1}(x_1,\dots,x_k,x_{k+1}),
\end{align*}
we obtain
\begin{align*}
T \models \forall x_1\dots \forall x_k
\left(
\theta_k(x_1,\dots,x_k)
\to
\exists x_{k+1}\,\theta_{k+1}(x_1,\dots,x_k,x_{k+1})
\right).
\end{align*}
Since $N \models T$ and $\bar{b}_k$ realizes $\theta_k$, the displayed implication holds in $N$ at $\bar{b}_k$. Hence there exists $b_{k+1} \in N$ satisfying
\begin{align*}
N \models \theta_{k+1}(\bar{b}_k,b_{k+1}).
\end{align*}
This is exactly the extension needed for the induction.
[/guided]
[/step]
[step:Define the limiting map and prove that it preserves all formulas]
Define the map
\begin{align*}
f: M &\to N \\
a_k &\mapsto b_k.
\end{align*}
This is well-defined because the enumeration of $M$ has no repetitions.
Let $m \in \mathbb{N}$, let $i_1,\dots,i_m \in \mathbb{N}$, and let $\varphi(y_1,\dots,y_m)$ be an $\mathcal{L}$-formula. Choose $k \in \mathbb{N}$ such that $i_1,\dots,i_m \leq k$. Define the $\mathcal{L}$-formula
\begin{align*}
\psi(x_1,\dots,x_k) := \varphi(x_{i_1},\dots,x_{i_m}).
\end{align*}
Since $\theta_k$ isolates $\operatorname{tp}^M(\bar{a}_k/\varnothing)$ and $N \models \theta_k(\bar{b}_k)$, the tuples $\bar{a}_k$ and $\bar{b}_k$ satisfy the same $\mathcal{L}$-formulas. Therefore
\begin{align*}
M \models \psi(\bar{a}_k)
\quad\Longleftrightarrow\quad
N \models \psi(\bar{b}_k).
\end{align*}
By the definition of $\psi$, this is precisely
\begin{align*}
M \models \varphi(a_{i_1},\dots,a_{i_m})
\quad\Longleftrightarrow\quad
N \models \varphi(f(a_{i_1}),\dots,f(a_{i_m})).
\end{align*}
Thus $f$ preserves and reflects every $\mathcal{L}$-formula on every finite tuple from $M$.
Taking $\varphi(y_1,y_2)$ to be $y_1 = y_2$ shows that $f$ is injective. Since $f$ preserves and reflects every formula, it is an elementary embedding $M \to N$.
[/step]
[step:Conclude primeness]
The model $N \models T$ was arbitrary. We have shown that for every model $N \models T$ there exists an elementary embedding
\begin{align*}
f: M \to N.
\end{align*}
Therefore $M$ is prime.
[/step]