http://babelstone.blogspot.com/2006/06/rules-for-long-s.html
For English texts:
* short s is used at the end of a word (e.g. his, complains, succeſs)
* short s is used before an apostrophe (e.g. clos'd, us'd)
* short s is used before the letter 'f' (e.g. ſatisfaction, misfortune, transfuſe, transfix, transfer, succeſsful)
* short s is used after the letter 'f' (e.g. offset), although not if the word is hyphenated (e.g. off-ſet)
* short s is used before the letter 'b' in books published during the 17th century and the first half of the 18th century (e.g. husband, Shaftsbury), but long s is used in books published during the second half of the 18th century (e.g. huſband, Shaftſbury)
* short s is used before the letter 'k' in books published during the 17th century and the first half of the 18th century (e.g. skin, ask, risk, masked), but long s is used in books published during the second half of the 18th century (e.g. ſkin, aſk, riſk, maſked)
* Compound words with the first element ending in double s and the second element beginning with s are normally and correctly written with a dividing hyphen (e.g. Croſs-ſtitch, Croſs-ſtaff), but very occasionally may be written as a single word, in which case the middle letter 's' is written short (e.g. Croſsſtitch, croſsſtaff).
* long s is used initially and medially except for the exceptions noted above (e.g. ſong, uſe, preſs, ſubſtitute)
* long s is used before a hyphen at a line break (e.g. neceſ-ſary, pleaſ-ed), even when it would normally be a short s (e.g. Shaftſ-bury and huſ-band in a book where Shaftsbury and husband are normal), although exceptions do occur (e.g. Mans-field)
* short s is used before a hyphen in compound words with the first element ending in the letter 's' (e.g. croſs-piece, croſs-examination, Preſs-work, bird's-neſt)
* long s is maintained in abbreviations such as ſ. for ſubſtantive, and Geneſ. for Geneſis (this rule means that it is practically impossible to implement fully correct automatic contextual substitution of long s at the font level)