This is code derived from rUnits, so I don't know if it's exactly compatible to pUF/oUF, but you can try it.
local temptoggle = CreateFrame"Frame"
temptoggle:SetScript("OnEvent", function(self, event, ...)
if GetNumRaidMembers() > 1 then
if GetNumRaidMembers() > 6 then
raid:Show()
party:Hide()
if GetNumRaidMembers() < 6 then
party:Show()
raid:Hide()
end
elseif GetNumPartyMembers() > 1 then
party:Show()
end
end)
This should show any raid over 6 members as raid frames, and anything under 6 people as party frames. Party frames will always show if you're in a party.
This is located in the layout file.