Is there any instance to where I should capitalize the word president?

Example

The next one was guerrilla warfare, which lasted for three years, in which president William Howard Taft...

Yes, definitely capitalize President when preceding his name.

Many years ago I was taught to always capitalize President when it referred to the U.S. president. However, that's gone out of style. Check this site for more information.

https://www.dictionary.com/e/when-do-you-capitalize-president/

Yes, there are instances where the word "president" should be capitalized. Here are a few situations:

1. When it is used as a title before a specific person's name: For example, "President Joe Biden" or "Former President Barack Obama."

2. When used as a proper noun: If you are referring to a specific president or a specific presidency, it should be capitalized. For example, "The Presidency of Franklin D. Roosevelt" or "The First Female President."

3. When referring to the President of a country: For example, "The President of the United States" or "The President of France."

4. When used at the beginning of a sentence: Like any other word, "President" should be capitalized when it begins a sentence.

Remember, capitalization rules can vary depending on the style guide or context. It's always a good idea to consult relevant style guides or resources for specific writing conventions or guidelines.