The first interval should always be a P1, P5, or P8 above the cantus firmus (bass voice):

The final cadence usually uses the vertical intervals 6-6-8 or 3-3-1. This is the result of a common 16th-century cadence featuring descending motion in the bass (MI-RE-DO) and leading tone motion in the soprano (DO-TI-DO).

Regarding the final two notes: one voice will have a melodic half step; the other voice will have a melodic whole step. In some modes (Dorian, Mixolydian, and Aeolian), this requires raising the seventh scale degree to produce a leading tone. In Phrygian, the half step exists between scale degrees 2 and 1 (RA-DO) and so the raised leading tone is NOT required.