Discount codes will not work for memberships that are set to bill in the future. Upon purchase, customers will be initially "charged" $0 to acknowledge the order and discounts cannot be applied to $0. The customer will receive the actual charge of the membership on a specified start date or upon activation.
To ensure that customers purchasing the membership (that bills at a later date) receive a discount, you can configure an automatic discount for the membership.