Made the leg IK bone, tried to attach the upper leg bone to the pelvis but after attaching it, the body rotates a little bit
In Pose mode, select your right lowerleg, go into Properties > Bone Constraints, and in your IK Constraint, change the Chain factor from 0 (influence the whole armature) to 2 (only influence 2 bones)