As far as staying in ketosis is concerned, the only macro that matters is carbohydrate, which needs to be kept below your threshold of tolerance, so as to keep insulin low. This is especially important if you are trying to shed excess fat, because an elevated level of insulin traps fatty acids in our fat cells. If your insulin is low enough to permit you to be in ketosis, then it is low enough to allow excess fat out of your adipose tissue, so it can be metabolised.
We recommend a limit of 20 g/day of carbohydrate, because that is a level that gets virtually everyone into ketosis. Once you have become fat-adapted, which takes between six and eight weeks for the majority of people, you can experiment with raising your carb intake to see at what level you stop being in ketosis.
Macros are calculated as a percentage of total calories consumed in a day. This is a holdover from the practice of 150-170 years ago, when the caloric value of food was the only thing they could measure.
In your calculations, remember that carbohydrate and protein both contain around 4 (kilo)calories per gram, whereas fat contains 9. So if you eat 20 grams of carbohydrate, that’s 80 calories, 300 grams of protein would be 1200 calories, and 300 grams of fat would be 2700 calories. Note that if you eat an equal amount of fat and protein by weight, then you are getting 69% of your calories as fat, and 31% as protein. (Of course, if you count the 80 calories of carbohydrate in the total, that affects the arithmetic slightly.)