Finding the matrix A in Ax=b I am watching the linear algebra course of MIT presented by Gilbert Strang and in Lecture 13 he solves the equation $Ax = b$. This is not the usual "find $x$", instead $x$ and $b$ are given and we need to find the matrix $A$ The link is at https://www.youtube.com/watch?v=l88D4r74gtM&t=841s at about minute 14:00. We know: 
$Ax = b$
$b=\begin{bmatrix}2\\4\\2\end{bmatrix}$
$x=\begin{bmatrix}2\\0\\0\end{bmatrix}$ + $c\begin{bmatrix}1\\1\\0\end{bmatrix}$ + $d\begin{bmatrix}0\\0\\1\end{bmatrix}$
$\dim N(A)=2$
$A$ is a $3\times 3$ matrix.
But you can see all of that in the video, it looks much clearer on a blackboard.
I am having problems understanding what did professor Gilbert do to get the answer $A=\begin{bmatrix}1&&-1&&0\\2&&-2&&0\\1&&-1&&0\end{bmatrix}$
I just don't seem to understand what happened, at all. How did he come up with the first column? Then how about the other 2? How did he use the nullspace? Why did it work? How did he use $x$ and $b$ ?

It's again a linear system, with unknowns living in a vector space, precisely the $3\times 1$ column vectors. Write $A=[a_1\ a_2\ a_3]$; then you know that
$$
\begin{cases}
2a_1 = b & (c=0,\;d=0) \\[4px]
3a_1+a_2=b & (c=1,\;d=0) \\[4px]
2a_1+a_3=b & (c=0,\;d=1)
\end{cases}
$$
This immediately entails that $a_3=0$, $a_1=\frac{1}{2}b$ and
$$
a_2=b-3a_1=-\frac{1}{2}b
$$
You could even do (formal) Gaussian elimination!
\begin{align}
\left[\begin{array}{ccc|c}
2 & 0 & 0 & b \\
3 & 1 & 0 & b \\
2 & 0 & 1 & b
\end{array}\right]
&\to
\left[\begin{array}{ccc|c}
1 & 0 & 0 & b/2 \\
3 & 1 & 0 & b \\
2 & 0 & 1 & b
\end{array}\right]
&& R_1\gets \tfrac{1}{2}R_1
\\[4px]&\to
\left[\begin{array}{ccc|c}
1 & 0 & 0 & b/2 \\
0 & 1 & 0 & -b/2 \\
0 & 0 & 1 & 0
\end{array}\right]
&& \begin{aligned} R_2&\gets R_2-3R_1\\R_3&\gets R_3-2R_1\end{aligned}
\end{align}
