B. The occasion and the audience
You should always consider who you are talking to and the occasion you are talking for when it comes to formal vs informal. For example a school speech would be a different occasion than than a private conversation and you'd want to speak formally at the first and informally at the latter.