From the above mentioned symptoms, it seams like the child is suffering from some kind of respiratory disorder/circulatory disorder. He has problem in breathing and his nails have become blue which means there is low level or lack of oxygen circulating in the red blood cells. It is known as cyanosis.
It occurs when enough oxygen is not present in blood, thus making the skin or membrane below the skin turn purplish-blue.