Is Drupal following W3C standards? How to change the DOCTYPE? I tested two of my sites in W3C validator. One site passed the test and other site gave me lot of errors. Site2 was having the doctype -//W3C//DTD HTML+RDFa 1.1//EN instead of HTML5. But site1 was having HTML5. 

How to change the doctype to HTML5 for Site2?
This would completely depend on the theme you are using on the Drupal site, as the markup of the site is handled on the theme layer.
If you are using an HTML5 theme, then the it will show the appropriate DOCTYPE i.e. &lt;!DOCTYPE html&gt;. In short, your theme should support HTML5 in order to get the DOCTYPE.  

To answer your question, you'll need to either make your theme compatible to HTML5, or use any other HTML5 theme.
There is a very good article for Converting Your Drupal 7 Theme Into HTML5 which could give you a good start.