There are a number of different ways to show that a local diffeomorphism $f: X \rightarrow Y$ is a global diffeomorphism:
For example, this follows if $X$ and $f(X)$ are both connected and simply connected. (this appears to be incorrect based on the comments below)
Or if $X$ and $Y$ are both simply connected compact manifolds without boundary.
I think but am not sure that the statement also follows if $X$ and $Y$ are both simply connected manifolds without boundary and the map $f$ is proper.