Camshaft lobes consist of what we call a base circle, acceleration ramps, and the raised portion, commonly referred to as the 'lobe' although it's just a portion of the entire lobe.
Valve clearance needs to be set with cam in a position so where the maximum clearances exists between the valve stem itself (flathead) or lifter (overhead valve), which will be when the lifter would be riding on the base circle of the camshaft lobe. Ideally, you'd like to set clearance when the peak of the lobe is 180 degrees from the lifter. Piston TDC is not that place.
Fortunately, there's an easy way to determine the right place.
If you look at an end view of a camshaft, you'll see the intake and exhaust lobes are separated by approximately 90 degrees. A picture would truly be worth a thousand words here, but if can visualize this, you'll see that when the exhaust valve just starts to open, the lifter for the intake valve is approximately directly across from the peak of the lobe, the perfect place to set its clearance.
You'll also see that when the intake valve has just finished closing, the same thing is true for the exhaust valve.
Neither of these occur when the piston is at TDC. At TDC, both valves are about 45 degrees of cam rotation from their ideal position. Does it make a lot of difference? Probably not, but .001" on a .006" clearance is a 16 percent error...so why not do it right?
Summarizing:
Rotate crankshaft in normal direction until the intake valve has just finished closing. At that point, set the exhaust valve clearance.
Continue rotating crankshaft in normal direction of travel until exhaust valve has just started to open. Set the intake valve clearance.