Where should I put the least worn tyre? on the front or the back? This is for XC MTB.
The Good or less worn tire should go on the front wheel as indicated in this Sheldon Brown Article on Tire Rotation
Although the article does hint to the fact that you should not be really rotating tires to the front wheel that may have been used on the rear wheel.
The only time tire rotation is appropriate on a bicycle is when you are replacing the rear tire. If you feel like taking the trouble, and use the same type of tire front and rear, you should move the front tire to the rear wheel, and install the new tire in front.
The reason for this is that the front tire is much more critical for safety than the rear, so you should have the more reliable tire on the front.
If you have a blowout, if it is on the rear tire, you have a very good chance of bringing the bike to a controlled stop. If your front tire blows, you can lose steering control, and a crash is a real possibility.
Generally you want the best tread on the front, as a front tire skid is much more dangerous than a rear tire skid.
However, I tend to ride my tires until the cord nearly shows, and, given that flats are about 5x more common on rear tires than front tires (and front-tire flats are much easier to fix), I'd be tempted to put the better tire on the rear, to reduce flat potential.
@MrDaniel has a very good answer, however if the bike is used XC MTB a blowout is less of a concern than handling when compared to a road bike, as MTB tires (in true off road conditions) loose performance as they loose tread, unlike a road tire. Your riding style and ground you ride will dictate to some extent what you do. If you have steep, slippery uphills and traction your most important problem, a better tread on the back helps. If control is your problem and you find the front a bit sketchy - then the new one on the front would be better.
If in doubt, don't loose any sleep over it - put it on either the one you are replacing (easy - only one tire change) or the front.
Don't forget that with MTB tires they are all quite different characteristics, build for particular combinations of riding conditions and tradeoffs. Some are designed specifically for back or front, or you change the rotation direction between front and back - therefore it is not as simple as just considering tread wear.
Least worn tyre on the front, always.
I have pretty worn tyres, the back is completely smooth, and the front has maybe half a mm of tread in the middle. Both have lugs on the shoulders.
We have been training hard for an upcoming 12-hour MTB endurance social event. All my rear-wheel slips have been recoverable, (at least a dozen), while both front wheel slips were complete wipeouts resulting in skidding, blood and one smashed phone.
That said - "sufficient" tread on both is a really good idea. You can get away with less tread on the road than off-road Except when the road is wet. If you have low tread on a road bike on a wet road - you will probably go down.
Place the less worn tire on the front. You need very little tread to achieve traction on the rear tire when climbing. Though counter intuitive, tire tread has very little impact on keeping your rear tire from slipping and spinning out on a climb. Maintaining traction is much more about torque, and weight and body positioning on the bike. I intentionally use a rear tire with low worn out center tread to reduce drag and increase rolling efficiency. Center tread on the rear tire may help keep the tail from bouncing and sliding around a bit, but this is not critical in maintaining control.
Very thoughtful considerations, especially directing the thinking towards MTB terrain given that so many folks drive to trails and might not worry about pavement wear and those safety concerns as much.
My knee-jerk reaction to the original question was a more superficial performance thought for a MTB:
If you rely on a knobby tread and encounter sloppy (muddy/wet) conditions with a worn-down rear tire and a newer front tire, you might be better served rotating the newer tire to the drive tire in the rear. It would have to be a pretty bald rear tire to make the swap noticeable though.
If I have two bald tires and only enough money for one tire, I'd definitely replace the back one first if the conditions are sloppy.