If it is underground right against the foundation footings you probably can't have more than two inches of vertical drop in total. You may not excavate below an imaginary surface starting at the bottom side edge of the foundation footing and extending away and slightly down at a 1:3 slope. If you set the drain pipe 1 foot away from the footing you can dig the trench no more than 4 inches below footing bottom level and gain a few more inches of vertical drop. The pipe at the high end has to be a few inches below the basement floor. And you need some gravel under the pipe.