In this case the domain of $\displaystyle f(x)= e^x$ is all real numbers because we can calculate $\displaystyle 2^{x}$ for x any real number. And, of course, the result of that calculation is always a positive number and can be any positive real number. That is why the range is all positive real numbers.
For $\displaystyle f(x)= log_2(x)$, the domain is all positive numbers because $\displaystyle log_2(x)$ (or logarithm of any base) is defined for all positive numbers but not for 0 or any negative numbers. If $\displaystyle 0< x< 1$, though, $\displaystyle log_2(x)< 0$ and $\displaystyle log_2(1)= 0$ so the range is all real numbers.
In fact, for any positive number, a, $\displaystyle a^x$ and $\displaystyle log_a(x)$ are inverse functions: if $\displaystyle y= a^x$ then $\displaystyle x= log_a(y)$ so they "swap" domain and range. That is also why the graphs are symmetric about the line y= x.