I haven't read the other replies but I am sure they cover everything. Firstly, knowing why your knees are bad is vitally important because you want to fix the issue before making it worse by training very hard. Chances are it's a fixable situation but I don't know all the details. BPC-157 and TB-500 can work wonders as can stretching and strengthening movements for the knees. For a new issue and localized inflammation I have always been a fan of ibuprofen/diclofenac gel and cold therapy.
If a certain movement causes bad pain simply don't do that movement. It doesn't matter if it's squats and people say you have to squat to get big legs (you don't) you simply don't do movements that hurt. Although maybe it's a form issue so you need to research optimal form for your body and play about with foot placement (etc) to make a movement better for your body.
Once all that is sorted the sky is the limit. For me for quads you can't go wrong with hack squats, leg press and leg extensions but there are many great options. For hams you want a stiff leg movement (SLDL) and a leg curl variation (seated being optimal then lying coming next and standing being mechanically inferior to both). Adductors should be a main focus as well and you want to hit all areas of your legs. Never neglect calves and I train them 1st 90% of the time. We could write about training all day but to keep it brief you want to train intensely and to failure using different rep ranges and sensible volume.
Don't get lost in numbers. You should always train hard and try to get progressively stronger but you 100% don't have to lift very heavy weights to get big legs. You can make smaller weights feel heavy especially if your knee issues can't be fully healed so don't be hurting yourself because you think you have to push big weights to build big legs.