you created a tiledlayout in one figure, set some of its characteristics but didn't add anything to it. Then you created a new figure with subplots, then you exported the (empty) tiledlayout.
Instead, use tiledlayout to set your layout shape, drop the call to figure, and use nexttile in place of the calls to subplot:
t = tiledlayout(2, 1, 'Padding', 'tight');
t.OuterPosition = [0.25 0.25 3 3];
exportgraphics(t, 'test.jpg', 'Resolution', 300)