SurajC
Total ways to arrange the 5 students = 5! = 120
I choose to subtract the "not allowed" ways of BD and DB from the total
ACEX, where X = BD
ACE can be rearranged in 3! and X (when expanded) can be rearranged in 2! = 12
Now taking X = DB, that is also 12.
You'll get the right answer here with a couple of adjustments. When we arrange your ACEX, we do indeed have 3! ways to arrange the "ACE", and 2! ways to arrange the "X" (or "BD"). So there are 12 sequences in that specific pattern. But you also need to arrange the ACE and the X -- you could have XACE, or AXCE, or ACXE, or ACEX. So you need to multiply by 4, to account for the 4 different places you could put the "X" among the other people. That would give you the correct number of arrangements, 48, which you can then subtract from 120 to get the answer.
You also doubled things twice, instead of just once -- when you say X can be arranged in 2! orders, you're accounting for the fact that X can be BD or DB. You then should not account for that a second time, by adding an extra 12 at the end.