Hi, ants and termites can nest in, around and underneath our houses. yes underneath as well! Pile of sand cannot clearly tell whether it is termites or ants. Have a closer look during the day. If there is a tiny que from the pile and leading to somewhere (on closer look you will see tiny insects marching to and fro from the pile)...then they are the ants. Ants are always on the go during the day time (sometimes at night too if they are inside the warm environment of the house).
Termites on the other hand are harder to see around the pile of sand they have created. However if there are small lines of sand branching out of the pile or anywhere near the pile (looking like branches) then they are definitely termites. Get a professional to get rid of them immeditely. They can eat away at the base of the house and do a lot of damage to wood and other material as well.
So just look for this difference...ants are marching in and out their house atleast during some part of the day and termite holes have branches like a tree (they may be short branches and may be long and widespread).
Hope this helps. Let me know. Best of Luck :)