From property (ii) it is easy to derive that $x\cdot x=r$ for all $x\in X$. Now if the multiplication is commutative, you have $x\cdot y=y\cdot x$ for all $x,y\in X$, and thus $(x\cdot y)\cdot(y\cdot x)=(x\cdot y)\cdot(x\cdot y)=r$. Thus according to property (ii), $x\cdot y=r$ for all $x,y\in X$, especially if $y=r$. However (i) says $x\cdot r=x$. Combining both gives $x=r$ for all $x\in X$, thus $X$ has only one element.
In addition, it is also easy to show that any $X$ fulfilling the definition also fulfils the other definition you've seen:
As noted above. from property (ii) follows that $x\cdot x=r$ for all $x\in X$, and therefore with the same calculation as above (but now no longer for arbitrary $x,y\in X$) $(x\cdot y)\cdot(y\cdot x)=r$, and therefore according to (ii) $x=y$. That $x=y$ implies $x\cdot y=y\cdot x$ is trivial. Thus we have that from the definition above the other definition follows.
However the reverse is not true, as the example $a\cdot b=a$ for all $a,b\in X$ shows: It has a right inverse (indeed, every element is a right inverse) and from $a\cdot b=b\cdot a$ it follows trivially that $a=b$ (the left hand side evaluates to $a$ and the right hand side to $b$). However from $a=b$ it does not follow that $a\cdot b=r$ no matter which element you choose to be $r$ (as I said, any qualifies). However, it might be that those other definitions further demand that the right identity is unique, in which case my counterexample would no longer qualify.