I think i have some knee problems as I usually feel sore there after an intense lower body work day. Also I have noticed that I have some symptoms of a knock knee,so I want to know the best stance width and toe position for least pain.I have noticed that pain is mostly when my knee goes forward, therefore I don't have much problem in heavy deadlift but much problem in back squat,even much less weight compared to DL.
It’s a matter of getting everything aligned properly. Which is hard to explain with words alone, but getting your knees in the right position will require you to get your hips and ankles in the right position. The video below demonstrates what should be going on.
Well, to begin with I would work on strengthening the knees.
A simple exercise you can do is to put one foot forward and focus most of your weight on it, as you tighten the quad. You're kind of pushing on your knee and down with the foot (but don't use your hands). You should feel the muscles around the knee tighten. Tighten and release a few times like this during warm-up and/or on rest days. Another good one is knee circles. Squat slightly and draw circles with your knees without moving the rest of your body too much.
Otherwise going into a more shallow squat should be easier on your knees. So would turning your toes out a bit - maybe 15 degrees outwards. So would a "neutral" stance - feet about hips width apart. A narrow stance will force your knees to work harder, and a wider stance would be conducive to your knees turning inward which may lead to misalignment of the knee cap (patella) - it tends to rotate inward.
TL;DR Squat more shallow and work on the root cause - strengthening your knees to alleviate the pain.
If you're having knee trouble with the squat then it's generally a good idea to minimize knee drift.
*/Which isn't necessarily the case with people squatting who don't have knee issues. I just want to note that knee drift is not necessarily a "bad thing." It can be if you have knee issues and you want to continue to squat.
Generally what I'd do with a client in this situation is likely box squats. Box squats generally force people to lean back more (the box/bench is there to catch you) and keep their shins more vertical. You can attenuate that position by blocking the knees with something too, like a training partners hands.
Of course general changes in technique may also be useful (screwing your feet in to the floor, changing the foot angle of the problematic knee, changing stance to wider or narrower, and adjusting depth are all valid) but a box squat is likely the fastest way to a pain free squat (with knee trouble) because it forces you to make a technique change that leads to a more vertical shin angle.
You could also try doing your warm up sets with a 9" or 11" looped band around your knees (just above or below) in addition to box squats. Just make sure you set up the safety pins in the power rack appropriately for that, it's a foreign feeling for most people.
Lastly there are also plenty of other exercises that train similar muscle groups to the squat. Exercises that would permit a more vertical shin (less knee drift) alignment on the front and potentially better train the muscles that counterbalance knock-knee postures (glutes/external rotators). Things like step-ups, maybe lunges (the back knee may be problematic though) or skater squats may be good accessory movements to add or to replace the squat until the knees start feeling better.