If you want to keep the first modal in the back, you have to do a couple of things. Note that it is not supported by bootstrap (using bootstrap 4.5).
As @fedda said, you need to specify a z-index on the modal element for it to be over the first one (1050 is the default) and then you have to also set the z-index of the backdrop (everything is darken in the back of the modal) to be over the first one and finally, if your first modal can be scrollable (big modal or small screen), you have to reconfigure the scroll to the first modal when the second one closes.
<div id="modal2" class="modal fade" style="z-index:1055">modal content here...</div>
Then in the script:
$("#modal2").on("hidden.bs.modal", () =>
{$("#modalintheback").data("bs.modal")._setScrollbar();}
$("#modal2").modal();
$("#modal2").next(".modal-backdrop").attr("style", "z-index:1054;");