There is no 'Lightroom 2022' but I assume you use Lightroom, meaning you posted this in the wrong forum, because this is Lightroom Classic forum. I moved it to the correct forum for you.
In Lightroom, you need to set the size to inches or centimeters, not pixels. Then you'll get an option to set the resolution in ppi (not dpi, images do not have dots).