The given reaction is $A+B\longrightarrow$ Product
Let us suppose the rate law of this reaction is:-
$Rate=K[A]^a[B]^b$
where $K$ is a rate constant.
$a$ and $b$ are order of the reaction with respect to the reactants $A$ and $B$ respectively.
Given that,
When [A] is doubled, the rate of the reaction is also doubled, so the reaction is first order $w.r.t. A$ and hence $a=1$
When $[A],[B]$ is doubled, the rate of reaction becomes $8$ times. Now,
$(Rate) _{new}=K [2A]^1[2B]^b$ $- (ii)$
$Rate=K[A]^1[B]^b$ $-(iii)$
Now, $\because$ New rate of reaction is $8$ times, so dividing $(ii)$ by $(iii)$ :-
$\Rightarrow 8=2.2^b$
$2^3=2^{1+b}$
Equating the exponents:-
$\Rightarrow 3=1+b\Rightarrow b=2$
So, order of reaction $w.r.t$ to $B$ is $2$
So, $Rate=K[A][B]^2$