Let $S$ be a set. For $\tau$ and $\tau'$ be topologies on $S$. Declare $\tau \leq \tau'$ meaning $id: (S,\tau) \rightarrow (S,\tau')$ is continuous. Determine formally the sufficient and necessary conditions on $S$ guaranteeing that this declaration is a linear order on the set of all topologies on $S$.
Attempt: I can first prove $\tau \subseteq \tau'$ iff $id: (S,\tau') \rightarrow (S,\tau)$ is continuous.
If $|S| <2 $, then there is a linear order. If $|S| = 0,1$, then there is a unique topology. Hence there is a linear order. This is a sufficient condition.
My problem is proving the necessary condition. I am guessing this is the necessary condition. If there is a linear order, then $|S| <2 $. I can see by example, that for $|S|=2,3,\cdots$, we can always finds two topologies $\tau_1$ and $\tau_2$, where you cannot say anything about $\subseteq$.
How could I prove formally that my necessary condition is correct.
You are correct that the sufficient condition you found is in fact necessary.
If there are two distinct elements $x_1,x_2$ in $S$, consider the following topologies on $X$: $$\tau_1=\{\varnothing,\{x_1\},S\},\qquad \tau_2=\{\varnothing,\{x_2\},S\}.$$ Then $\tau_1\neq\tau_2$, and neither map $id: (S,\tau_1) \rightarrow (S,\tau_2)$, $id: (S,\tau_2) \rightarrow (S,\tau_1)$ is continuous, so the two topologies cannot be compared. Thus if $\operatorname{card}(S)\geq2$, the collection of topologies of $S$ cannot be linearly ordered.