There are 2 definitions of Connected Space in my lecture notes, I understand the first one but not the second. The first one is:
A topological space $(X,\mathcal{T})$ is connected if there does not exist $U,V\in\mathcal{T}$ such that $U\neq\emptyset$, $V\neq\emptyset$, $U\cap V=\emptyset$ and $X=U\cup V$
which makes sense. It is saying that connected spaces can't be cut up into parts that have nothing to do with eachother.
The second definition is:
A topological space $(X,\mathcal{T})$ is connected if $\emptyset$ and $X$ are the only subsets of $X$ which are closed and open
which makes no intuitive sense to me, especially as a definition of connectedness.
Any intuitive explanation behind this second definition?
First of all the definitions are equivalent, you already got a few answers about that. I'll try to add some intuition. If $X$ is a topological space and $A\subseteq X$ then you can split the space into three parts: the interior of $A$, the boundary of $A$ and the exterior of $A$. The set $A$ is open if its boundary is contained in $X\setminus A$, and it is closed if its boundary is contained in $A$. So to say that $A$ is both open and closed is the same thing as to say that the boundary of $A$ is empty. Now imagine that the interior and the exterior of such a set $A$ are both not empty. The set has no boundary which can be crossed so intuitively to get from a point in the interior to a point in the exterior we have to "jump". This exactly means that we split the space into two parts which have nothing to do with each other, so such a space $X$ is not connected.
On the other hand if every set $A\subseteq X$ such that both $A$ and $X\setminus A$ are not empty has a boundary then intuitively it means that we can enter any set and get out of any set in a straight way by crossing its boundary. So it makes sense to say such a space $X$ is connected.