First, I wanted to point out that most of what you wrote is not correct. $t(x)\sim\frac{x}{\log x}$, not $\sim x$. This is because if $\sum_{p\leq x}\sim \text{li(x)}$, then we expect that by dividing by $\log p$, I will get $\text{li}(x)/\log(x)$, and then $t(x)\sim \text{li}(x)$. Also, the computations are way off. Checking on Matlab, I have that: $r(900000)=9000090.94\dots$ and hence $r(900000)-900000=90.94\dots$ You did not remove the primes correctly. Now lets prove all of this in full.
Some Rigorous Proofs: Lets go over everything in detail. The two series you are considering are
$t(x)=\log x\sum_{p\leq x}\frac{1}{\log p}$ and $r(x)=\log x\sum_{11\text{ is composite.}$ Notice that $r(x)+t(x)=\sum_{2\leq n\leq x}\frac{1}{\log n}$ so we need only evaluate $\sum_{2\leq n\leq x}\frac{1}{\log n}$ and $\sum_{p\leq x}\frac{1}{\log p}$. First
Lemma 1: $\sum_{2\leq n\leq x}\frac{1}{\log n}=\text{li}(x)-C+O\left(\frac{1}{\log x}\right)$ where the constant $C$ is given by $C=\int_{2}^{\infty}\frac{\left\{ t\right\} }{t\left(\log t\right)^{2}}dt.$
Proof: We may write this as a Riemann-Stieltjes integral: $\sum_{2\leq n\leq x}\frac{1}{\log n}=\int_{2}^{x}\frac{1}{\log t}d\left[t\right]=\int_{2}^{x}\frac{1}{\log t}dt-\int_{2}^{x}\frac{1}{\log t}d\left\{ t\right\}$ where $\left[t\right]$ and $\left\{ t\right\}$ are the floor and fractional parts of $t$, respectively. Using integration by parts and the definition of $\text{li}(x)$ this is $\text{li}(x)-\frac{\left\{ x\right\} }{\log x}-\int_{2}^{x}\frac{\left\{ t\right\} }{\left(\log t\right)^{2}}dt.$
Remark: Although I have not done the computation myself, I believe the constant $C$ can be cleaned up in terms of other known constants.
Lemma 2: We have that $\sum_{p\leq x}\frac{1}{\log p}=\text{li}\left(x\right)-\frac{x}{\log x}+O\left(xe^{-c\sqrt{\log x}}\right).$
Proof: If $\theta(x)=\sum_{p\leq x}\log p$, we may write $\sum_{p\leq x}\frac{1}{\log p}=\int_{2}^{x}\frac{1}{\left(\log t\right)^{2}}d\theta\left(t\right)=\int_{2}^{x}\frac{1}{\left(\log t\right)^{2}}dt+\int_{2}^{x}\frac{1}{\left(\log t\right)^{2}}d\left(\theta(t)-t\right).$ For the first term, notice that by integration by parts $\int_{2}^{x}\frac{1}{\log t}dt=\frac{x}{\log x}+\int_{2}^{x}\frac{1}{\left(\log t\right)^{2}}dt.$ For the second term we can use integration by parts along with the prime number theorem which states that $\theta(t)-t=O\left(xe^{-c\sqrt{\log x}}\right).$ Then $\int_{2}^{x}\frac{1}{\left(\log t\right)^{2}}d\left(\theta(t)-t\right)=\frac{\left(\theta(x)-x\right)}{\left(\log x\right)^{2}}+2\int_{2}^{x}\frac{\theta(t)-t}{t\left(\log t\right)^{3}}dt+O(1)$ $=O\left(xe^{-c\sqrt{\log x}}\right),$ and the lemma follows.
Consequences: Putting these two lemmas together, we find that: $t(x)=\text{li}(x)\log x-x+O\left(xe^{-c\sqrt{\log x}}\right),$ $r(x)+t(x)=\text{li}(x)\log x -C\log x+O\left(xe^{-c\sqrt{\log x}}\right).$ We have to put in the extra error term since we are subtracting $r(x)$, and this will consume the $C\log x$ term since it is larger. Hence $r(x)=x+O\left(xe^{-c\sqrt{\log x}}\right)$ and $r(x)-x=O\left(xe^{-c\sqrt{\log x}}\right).$
I hope that helps,