You can find the procedure for crude oil in 200.15 g) of the contract specifications. Allocation is assigned according to preference for foreign crude beginning with the largest preferences. My experience with taking delivery involved the oldest longs being matched with the oldest shorts i.e. depends on the contract and its specifications.