How can one detect how many coats of paint are used in a newly built house .
Crappy/crumbly paint is usually thin as well... and 2 coats thereof may (and often do) not cover or resist well. So it doesn't really matter how many coats are in the contract if the paint (or layer thickness) is not specified therein.



(Illustration from the previously linked article.)

Most industry tools/methods (destructive or non-destructive) can only measure total paint thickness, not count layers. The most reliable way to inspect/count/measure individual layers is a destructive method using a PIG (paint inspection gauge) using the ASTM D4138-07a method. The gauge cuts a v-groove that is examined using a built-in microscope, which looks like this:



(Image from tcq.eu.)

It takes considerable operator experience to distinguish layers of the same paint though... so if you're looking to sue or force them to repaint, better hire an expert to do this determination for you.

I've sanded a few things (to repaint) myself, and some of these had 3-4 different paints that were easy to distinguish while the sanding was going on; basically you get a much, much wider V-cut at the sanding edge... but I could never tell with the naked eye how many layers of each paint might have been there (and had no reason to get microscope).