I'm not sure I see the problem. Since the electric potential is a scalar quantity, you can just add the potential due to the line of charge $\lambda_1$ to the potential due to the line of charge $\lambda_2$. The first equation that you've written: $$\phi(x,y) = -2 \lambda \log\left(x^2 + y^2 \right),$$ is for a line charge of charge-per-unit-length $\lambda$ that is placed at $x=0$.
In the case of two such lines, what the author is doing is clearly placing the two line-charges $\lambda_1$ and $\lambda_2$ at positions $x=-R$ and $x=+R$ respectively. Thus:
$$\phi_1(x,y) = -2 \lambda_1 \log\left((x+R)^2 + y^2 \right),$$
$$\phi_2(x,y) = -2 \lambda_2 \log\left((x-R)^2 + y^2 \right).$$
From this, it should be trivial to see that since $$\phi(x,y) = \phi_1(x,y) + \phi_2(x,y),$$ your answer follows.
Note: There is a tiny subtlety here, you can only add the electric potentials like a scalar when they are measured from the same reference point (potentials are only defined up to an overall constant). Generally (with point charges, for example) we choose the point at infinity to be the point where $\phi\to0$. In the case of a single line of charge, however, the potential blows up at infinity and so this convention cannot be used. However, we always have the liberty to this reference point to be somewhere else. I leave it to you to find the reference point (i.e., the point at which the potential $\phi(x,y)$ is zero) in this case, and to convince yourself that it's justified.