Business inventories rose in both May and June according to figures released yesterday by the Commerce Department.

The department had previously thought that business had begun to run down its inventories during the second quarter. But it reported yesterday that inventories went up by $1.365 billion in June after seasonal adustments, on top of a rise now put at $858 million for May.

The original May figures published by Commerce showed inventories dropping by $425 million. The estimated fall in inventories during the four months March to June was one element in the sharp GNP drop recorded in the second quarter.

When the revised GNP figures are published next week they could show a smaller fall in economic output in the second quarter because of the unexpected build up in inventories. However the better figure for the second quarter is not necessarily a good sign.

Inventories built up in the three months to June will probably be run down later. Theodore Torda, senior economist at Commerce, said yesterday "business inventory liquidation will begin in earnest in the third quarter."

He said Commerce economists had been hoping that the liquidations which they thought had begun in May would continue in June. Courtenay M. Slater, Chief economist at Commerce, said when the GNP figures were published last month that the inventory decline was in a way a good thing. It meant that business would be better prepared for recession, and quicker to move out of decline if inventories and sales were not too far out of balance.

However the pick up in retail sales in May and June shown in recently published figures suggests that "inventory liquidation in the third quarter will not be greater than analysts expected," Torda said yesterday.

Falling inventories are nevertheless likely to be the main drag on business activity in the three months July to September, Torda predicted. Final sales will probably change very little, he said, with all the depressing effects on the economy in the quarter coming from declining inventories.

Manufacturers boosted their inventories by $300 million in June, the Commerce Department report showed. Merchant wholesalers saw a rise of $1.2 billion in the month, while retailers reduced holdings by $100 million.

For durable goods manufacturers and retailers, inventories went down by $100 million. This sector was the first, and hardest hit, by recession. Sales at the retail and wholesale level have started to recover with rises of 2 and 3 percent respectively in June. Inventories of merchant wholesalers in durable goods went up by $700 million in June.

The combined value of retail and wholesalers sales and manufacturers' shipments for June was little changed from May, the Commerce report said.