You can make your book for free on B&N if you distribute it through Smashwords.com (and have it for free there, the price will carry over).
To make something for free on Amazon, you have to either put the book into the KDP Select program(in which case you can't have it available ANYWHERE ELSE for 90 days), or have the book price-matched down to free(if you have it for free somewhere else, and enough people notify Amazon about this on the produce details page, they will eventually price-match it down to free).
KDP Select locks your book out from other places, and you only get a limited amount of FREE days for the entire 90 day period. Amazon Prime Kindle owners can borrow your book for free, though(and you'll still get money from it).
The price-matching way is technically against the KDP ToS, but it's still widely done. They -can-(technically) remove your book from KDP and/or delete your account for a violation of the ToS, though(you agree to keep the prices of your book the same at every retailer, which is standard ToS fare), but I've never actually heard of this happening since you also agree that they can change the price of your book if necessary to remain competitive.
Why do you want to give your book away? Is it in the public domain? If it is, then neither B&N PubIt! nor Amazon KDP allow you to publish it through their self-publish services. Both services want you to have exclusive copyrights to the work.
Kind regards, David