This types of questions are under the category of grid automata.Only minor modification is done in the final states.In all such questions if we require m a's and n b's , then a grid of (m+1)(n+1) states is required and one trap state is also required for the case if we use the keyword "at most" or "exactly" and only what will vary is the selection of final states based on these keywords(at least , exactly , at most).Let us see how to do these questions :
As we can see we have to ensure that we need exactly 2 b's so if further b is read in a state after reading 2 b's , then we transit that state to trap state on the input b.And only Q5 is the final state since we require at least 1 a so Q4 is not the final state in the 1st automata.
Similarly we proceed for 2nd question as well.