It is 500 miles minimum per segment.
UNLESS there is one flight number for the itinerary.
Given your routing, that is not so, so you will not get the direct point-to-point miles from BWI-BUF-BWI. You will get 500 base miles * 4 segments - 2000 base/EQM miles. Unless, of course, any of those segments exceed 500 miles, in which case you will get the actual mileage...sorry, too lazy to check this.