How do I depend on a specific version of a homebrew formula

Homebrew is still improving their support for depending on old versions of a library, with some planned improvements in this issue. In the meantime, you can use the homebrew/versions tap, which has formulae for boost 1.55 and boost 1.59. To depend on these versioned formulae, you could use the following:

depends_on "homebrew/versions/boost155"

or

depends_on "homebrew/versions/boost159"

EDIT:

You mentioned lack of documentation about conflicts. There is a conflicts_with keyword, but that is more about conflicts with being installed side-by-side. There's also a fails_with keyword, but that is related to specific versions of compilers. I think using depends_on with a formula from homebrew/versions will work best for you.