Energy forecasting is an important application of machine learning in renewable energy because it is used for operational, management, and planning purposes. However, using the electricity load dataset during COVID-19 is a research challenge in the forecasting model due to the limited dataset and non-stationarity. This paper proposes an extreme gradient boosting (XGBoost) forecasting model for a limited dataset. Forecasting models require large amounts of data to create high-accuracy models. We conduct research using the PT Biofarma office electricity usage dataset for eight months during the COVID-19 period. Because office activities were limited during the pandemic, the datasets obtained were few. Several methods are used for modeling limited datasets, namely XGBoost, multi-layer perceptron (MLP), autoregressive integrated moving average (ARIMA), and long short-term memory (LSTM). We have conducted several experiments using a limited dataset with these four methods. The test results with the t-test show that the electricity load data for work-from-office (WFO) and work-from-home (WFH) periods have a significant average difference. Then the test results with the augmented Dickey–Fuller (ADF) test show that our data is non-stationary. Compared to the benchmark method, the XGBoost method shows the best forecasting performance with mean absolute percentage error (MAPE), root mean squared error (RMSE), mean absolute error (MAE), and R2 of 0.48, 5.00, 3.09, and 0.61 respectively.