5000 cal without gaining fat is impossible
But what you should do, download my fitness pal and first plan your essential nutrients, protein and fat. protein have 4 cal and you should take max 2g per bodyweight plus 9 cal per fat. The rest you fill up 4 hours around your workout with carbs and off you go.
If you want to program your body for fat burning, don't eat carbs with your first meal, I go for:
wake up and open your eyes, get yourself 30g whey, fresh pressed lemon, 1-2 serving off greens and 1 tablespoon off coconut oil. If you bulk get some HMB (3g leucine).
Breakfast should be high fat and fiber again, I go for meat and nuts breakfast (200g organic grass fed tenderloin, 1 oz Brazilian nuts and 1-2 serving greens)
This programs your body in the morning for fat burning, the rest off the day you split your carbs.
By the way, keto is good for cutting, but not for bulking
I hope your bf is around 10%, if not you shouldn't bulk I guess