Let $A=\begin{pmatrix}2&1\\2&0\\1&1\end{pmatrix}$ find $Q$ and $R$ such that $A=QR$.
First I tried to find $Im(A)=\{(a,b,c)\in\mathbb{R}^3|Ax=(a,b,c)compatible\}.$
so then solving a system we get: $Im(A)=Sp\{(1,0,1),(0,2,-1)\}$ after that i orthogonalized all this using Gram-Schmidt algorithm obtaining: $Sp\{(1,0,1),(3,1,2)\}$ orthogonal base. So then I thought $Q$ will be the matrix formed by vectors from the orthogonal base on columns, but it's not that... What am I doing wrong?
I'm not certain where you went wrong because I can't see your work.
Suppose that $A$ is given by
$$ A = \begin{bmatrix} 2 & 1 \\ 2 & 0 \\ 1 & 1 \end{bmatrix} \tag{1} $$
find $A = QR$
In Gram-Schmidt you successfully take columns $v_{i}$ and normalize them
$$ v_{1} = a_{1} = \begin{bmatrix}2 & 2 & 1 \end{bmatrix} \tag{2} $$
e.g $ q_{1} = \frac{v_{1}}{\|v_{1}\|}$
$$ q_{1} = \frac{v_{1}}{\|v_{1} \|} = \frac{1}{\sqrt{9}}\begin{bmatrix}2 & 2 & 1 \end{bmatrix} =\begin{bmatrix}\frac{2}{3} & \frac{2}{3} & \frac{1}{3} \end{bmatrix}\tag{3} $$
then we subtract off our orthonormal vector $q_{1}$ from $a_{2}$ using a coefficient $(a_{2} \cdot q_{1})$. This happens to be $ r_{12}$ $$ v_{2} = a_{2} - (a_{2} \cdot q_{1})q_{1} = \begin{bmatrix} 1 & 0 & 1 \end{bmatrix} - 1 \cdot \begin{bmatrix}\frac{2}{3} & \frac{2}{3} & \frac{1}{3} \end{bmatrix} = \begin{bmatrix}\frac{1}{3} & \frac{-2}{3} & \frac{2}{3} \end{bmatrix} \tag{4} $$
we then normalize our new vector generating $q_{2}$
$$ q_{2} = \frac{v_{2}}{\|v_{2}\|} \tag{5}$$
$$ \| v_{2}\| = \sqrt{(\frac{1}{3})^{2} +(\frac{-2}{3})^{2} + (\frac{2}{3})^{2}} =1 \tag{6}$$
$$ Q = \begin{bmatrix} \frac{2}{3} & \frac{1}{3} \\ \frac{2}{3} & \frac{-2}{3} \\ \frac{1}{3} & \frac{2}{3} \end{bmatrix} = \frac{1}{3} \begin{bmatrix} 2 & 1 \\ 2 & -2\\ 1 & 2 \end{bmatrix} \tag{7} $$
then the matrix $R$ is given by the inner products of the orthogonal components and the vectors of the original matrix.
$$ R = \begin{bmatrix} a_{1} \cdot q_{1} & a_{2} \cdot q_{1} \\0 & a_{2} \cdot q_{2}\end{bmatrix} = \begin{bmatrix} r_{11} & r_{12} \\ 0 & r_{22} \end{bmatrix} = \begin{bmatrix} 3 & 1 \\ 0 & 1 \end{bmatrix} \tag{8} $$
this is confirmed here with some python
It isn't unique so python may give something close to it.