Hereby (en toutōi). John’s usual phrase for the test of the sincerity of our love. “The love of God and the love of the brethren do in fact include each the other” (Westcott). Each is a test of the other. So put 1Jo 3:14 with 1Jo 5:2.
When (hotan). “Whenever” indefinite temporal clause with hotan and the present active subjunctive (the same form agapōmen as the indicative with hoti (that) just before, “whenever we keep on loving God.”
And do (kai poiōmen) “and whenever we keep on doing (present active subjunctive of poieō) his commandments.” See 1Jo 1:6 for “doing the truth.”