In the first paragraph of p.41 of Introduction to: classification theory for abstract elementary class, Shelah gives the following definition of (Galois) type.
For $M\preceq N_\ell$ and $a_\ell\in N_\ell \setminus M$, $\mathbf {tp}(a_1,M,N_1)=\mathbf{tp}(a_2,M,N_2)$ iff for some $\preceq$-extension $N_3$ of $N_2$ there is a $\preceq$-embedding of $N_1$ into $N_3$ over $M$ which maps $a_1$ to $a_2$, recalling that $\mathfrak K_\lambda$ has amalgamation.
I have omitted references in the notation to the AEC $\mathfrak{K}_\lambda$ in which this is taking place.
How do I see that this definition is equivalent to the following definition?
For $M\preceq N_\ell$ and $a_\ell\in N_\ell \setminus M$, $\mathbf {tp}(a_1,M,N_1)=\mathbf{tp}(a_2,M,N_2)$ iff there exist $\preceq$-embeddings $h: N_1\to N_3$ and $g:N_2\to N_3$ such that the resulting square commutes and $h(a_1) = g(a_2)$.
Also:
Why does Shelah write "recalling that $\mathfrak K_\lambda$ has amalgamation" after his definition?
In the definition, why does Shelah write $\mathbf{tp}_{\mathfrak{K}_\lambda}(a_1,M,N_1)=\mathbf{tp}_{\mathfrak{K}}(a_2,M,N_2)$? (Note: there is no $\lambda$ in the r.h.s.,but there is one in the l.h.s.)
In the second definition, do we assume that $g$ and $h$ fix $M$?
These definitions are saying almost exactly the same thing. They really only differ in whether they require $N_2$ to be a substructure of $N_3$, or just embedded into it.
Suppose $\mathbf{tp}(a_1,M,N_1) = \mathbf{tp}(a_2,M,N_2)$ in the sense of the first definition. Then we have an extension $N_2\preceq N_3$ and a $\preceq$-embedding $h\colon N_1\to N_3$ over $M$ such that $h(a_1) = a_2$. Taking $g$ to be the inclusion $N_2\to N_3$, we find that the square commutes: for all $m\in M$, $h(m) = m = g(m)$. [This is what it means to say that $h$ is a map over $M$.] And $h(a_1) = a_2 = g(a_2)$. So $\mathbf{tp}(a_1,M,N_1) = \mathbf{tp}(a_2,M,N_2)$ in the sense of the second definition.
Conversely, suppose $\mathbf{tp}(a_1,M,N_1) = \mathbf{tp}(a_2,M,N_2)$ in the sense of the second definition. Then we have $\preceq$-embeddings $h\colon N_1\to N_3$ and $g\colon N_2\to N_3$ such that the resulting square commutes and $h(a_1) = g(a_2)$. Now we may assume that $N_2\preceq N_3$ and $g$ is the inclusion mapping, by replacing $N_3$ with an isomorphic copy. And then $h(a_1) = g(a_2) = a_2$, so $\mathbf{tp}(a_1,M,N_1) = \mathbf{tp}(a_2,M,N_2)$ in the sense of the first definition.
For your additional questions: