Do you socialise with him outside of work? I find that's the best way to become more comfortable around workmates, and get to know each other a lot better, including how you all feel about each other. My suggestion would be to try to organise farewell drinks or something like that. Ask him first, so you make sure the day and time suits him (otherwise you might end up going for drinks with everyone but him if he's busy!).
If you do have some sort of farewell get together, it's a great time to get his number, just say you'd like to keep in touch if you don't feel bold enough to tell him how you feel. You could do that on your last day anyway, even if you don't go out.