Don't know how to make two selects bridge together ad run a single query
you need to reference the race fields in the initial SELECT statement (before the FROM clause) with an alias to the inner select.  I'm not quite sure what it is that you're trying to accomplish, but this is certainly more on track with what you desire.  Try this for starters

SELECT
    s.student_number,
    s.dob,
    s.gender,
    s.ethnicity,
    RaceTable.race1,
    RaceTable.race2, 
    RaceTable.race3
FROM students s INNER JOIN
    (SELECT
        lastfirst, grade_level,
        max(case when rn = 1 then racecd end) race1, -- find 1st row
        max(case when rn = 2 then racecd end) race2, -- find 2nd row
        max(case when rn = 3 then racecd end) race3  -- find 3rd row
     FROM
         (SELECT
             st.lastfirst,st.grade_level,sr.racecd,
             st.student_number,st.dob,st.gender,st.ethnicity,
             row_number() -- one row per race, numbered 1,2,3,...
                 over (partition by sr.studentid 
                 order by sr.racecd) rn
          FROM students st
          JOIN studentrace sr
              ON st.id=sr.studentid
          WHERE st.enroll_status=0
         ) AS RTinner
     GROUP BY lastfirst,grade_level
  -- ORDER BY grade_level asc
    ) AS RaceTable
ON s.lastfirst=Racetable.lastfirst AND
   s.grade_level=Racetable.grade_level