Okay so they are slightly different in the way they approach things, and the first one contains an error. Let me walk you through them.
To make it more obvious what’s happening I will change all domains in all rules to example.com
First up
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
This one contains an error, the . in line example.com in the RewriteCond should have been escaped, i.e., it should have been example\.com. So
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
What this rule now does is rewrite every request for example.com (without the www) to [noparse]www.example.com[/noparse].
The (.*) isn’t the best idea ever, but I’ll get to that later
The second one
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
After fixing the error in the first one this one is now exactly the same but uses domain.com instead of mydomain.com
The third one
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\\.example\\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
This one changes it around a bit.
If the request is not for [noparse]www.example.com[/noparse], rewrite to [noparse]www.example.com[/noparse]. This will rewrite all subdomains to www.
So if you have subdomains, like [noparse]my.example.com[/noparse] or something like that, you should be using the first rule because you don’t want to rewrite those.
I personally find 3 a bit overkill and would stick with the first one anyway.
As for the (.*), this is known as greedy regex in that it will capture everything and anything, while what you need here is already available in a variable from Apache, namely %{REQUEST_URI}. We’d better use that instead as that causes less work for Apache.
So, the ultimate version would be (IMHO)
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\\.com [NC]
RewriteRule .? http://www.example.com%{REQUEST_URI} [R=301,L]
For a good tutorial on mod_rewrite and how all this stuff works, have a look at http://www.datakoncepts.com/seo
HTH 