Multiple counts in a SQL statement
COUNT counts values that are not NULL. You can transform the unneeded values into NULL for example with DECODE. Combining the two as below:

select
    student_id, 
    count(decode(attendance_id, 'ABSENT', 1, null)) as absent_count,
    count(decode(attendance_id, 'PRESENT', 1, null)) as present_count,
from
  attendance
group by
  student_id
;


Or you could put 0 instead of null and use SUM.